We can use DATEADD() function to Subtract days from DateTime in Sql Server.
DATEADD() functions first parameter value can be day or dd or d all will return the same result.
Here is the query which shows how we can get date of last week from Current DateTime in Sql Server.
Script Snippet:
SELECT GETDATE() ‘Today’,
DATEADD(day,-7,GETDATE()) ‘Last week’
SELECT GETDATE() ‘Today’,
DATEADD(dd,-7,GETDATE()) ‘Last week’
SELECT GETDATE() ‘Today’,
DATEADD(d,-7,GETDATE()) ‘Last week’