Skip to Content
0
Former Member
Nov 21, 2011 at 03:43 AM

Querr Different of Days Excluding Weekends

46 Views

Hi All,

I use below to query different of days between 2 dates. How if I want to query the different of days which will EXCLUDE the weekends.

Also, how to convert the character to integer for calculation if the UDFs was first created as Character?

SELECT datediff(d ,T0.U_Arrivaldate,T0.U_DateToDone) 'remaining days' FROM OSCL T0

WHERE T0.U_Arrivaldate >= T0.U_DateToDone AND

(T0.U_Arrivaldate BETWEEN '[%0]' AND '[%0]' AND T0.U_DateToDone BETWEEN '[%1]' AND '[%1]' )

Hope for answer.. Thanks!