how to get data of current week only in SQL server?

前端 未结 7 1983
逝去的感伤
逝去的感伤 2020-12-29 03:18

I want records from table which stores the current date when a record is inserted with in current week only.

I have tried:

SELECT PId 
,WorkDate 
,Ho         


        
7条回答
  •  长情又很酷
    2020-12-29 04:01

    Its Working For Me.

    Select * From Acb Where WorkDate BETWEEN DATEADD(DAY, -7, GETDATE()) AND DATEADD(DAY, 1, GETDATE())
    

    You have to put this line After the AND Clause AND DATEADD(DAY, 1, GETDATE())

提交回复
热议问题