sql substract date code example
Example 1: 3 days back in sql server
DATEADD(DAY, -3, GETDATE())
Example 2: sql get number of days between two dates
DATEDIFF(DAY, '1/1/2011', '3/1/2011')
DATEADD(DAY, -3, GETDATE())
DATEDIFF(DAY, '1/1/2011', '3/1/2011')