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