How do I exclude Weekend days in a SQL Server query?

前端 未结 7 2467
[愿得一人]
[愿得一人] 2020-11-27 03:20

How do I exclude values in a DateTime column that are Saturdays or Sundays?

For example, given the following data:

date_created
\'2009-1         


        
7条回答
  •  情话喂你
    2020-11-27 04:08

    Try this code

    select (DATEDIFF(DD,'2014-08-01','2014-08-14')+1)- (DATEDIFF(WK,'2014-08-01','2014-08-14')* 2)
    

提交回复
热议问题