How to Get Non Weekend DatesPosted: May 20, 2013
Give you a given date, how to find out whether it is a weekend date. You may start with with DATEPART(dw, GETDATE()). Due to the different environment with SET LANGUAGE, you may have different SETFIRST value.
But if you can use a calculation to include this datefirst difference, you can get a solution that works for all environments.
(DATEPART(dw, getdate())+@@DATEFIRST)%7 not in (0,1).
An example to use this:
Select * from yourtable where (DATEPART(dw, dtColumn)+@@DATEFIRST)%7>1