Skip to main content
  1. Posts/

Pro Tip : SQL Tips

·50 words·1 min
Author
Gregor Suttie
Passionate about all things Azure. Microsoft Azure MVP, blogger, speaker and community enthusiast based in Scotland.

Calling a udf from SQL Query Analyser SELECT dbo.udf_calculate_working_days(‘01/01/2000’, ‘01/01/2001’)

Calling a Table valued function from SQL Query Analyser SELECT * from dbo.udf_calculate_working_days(‘01/01/2000’, ‘01/01/2001’)

Get the number of days between 2 dates SELECT DATEDIFF(dd, ‘01/01/2009’ , ‘01/01/2010’) as ’total_days’

SQL for when checking against todays date SELECT DATEADD(dd, DATEDIFF(dd,0,@order_date), 0

Share this:

Related