Alex Rivera | Logout

Adding a month to a date in T SQL

Asked 2011-11-01T13:50:01.227
43

How can I add one month to a date that I am checking under the where clause?

select *
from Reference
where reference_dt + 1 month
Edit
Report

1 Answer

17

You can use DATEADD function with the following syntax

DATEADD (datepart, number, date)

In your case, the code would look like this:

...
WHERE reference_dt = DATEADD(MM, 1, reference_dt)
answered 2011-11-01T13:51:40.807

Your Answer