analog to MySQL's DATE_SUB / INTERVAL

sql-server, t-sql

Solution

try this

SELECT DATEADD(month, -1, GETDATE());

Problem

In MySQL the following will tell you what the date was a month ago: ``` SELECT DATE_SUB(NOW(), INTERVAL 1 MONTH); ``` The SQL fiddle. How can this be done in SQL Server?

Original source