bildozer
asked on
Date between Monday and previous day of week in TSQL
I'm trying to pull all records between Monday and the day before.
For instance, on Thursday, I need the date range of Monday through Wednesday.
I've got a script that uses the following code:
This gives the range a start day of Sunday. How should I modify it to treat Monday as the start of the week?
Thanks in advance.
For instance, on Thursday, I need the date range of Monday through Wednesday.
I've got a script that uses the following code:
SELECT * from dbo.events
WHERE dbo.events.eventdate BETWEEN DATEADD(wk,DATEDIFF(wk,7,getdate()),6) and getdate()
This gives the range a start day of Sunday. How should I modify it to treat Monday as the start of the week?
Thanks in advance.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.