Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql server get date of previous sunday

--start of last week
SELECT DATEADD(wk, DATEDIFF(wk, 6, GETDATE()), 0)

--end of last week
SELECT DATEADD(wk, DATEDIFF(wk, 6, GETDATE()), 6)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sql #server #date #previous #sunday
ADD COMMENT
Topic
Name
7+4 =