Build and Execute
Bits of useful information technology.
Tuesday, May 28, 2013
Add days, months, or years to a date in SQL
Use the following:
DATEADD(month, -3, GETDATE())
This example gets a date 3 months prior to the current date. Use "day", or "year" in place of "month" to do similar calculations with those units.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment