Showing posts with label add A Month IN DATE. Show all posts
Showing posts with label add A Month IN DATE. Show all posts

Saturday, April 14, 2012

how to add A DAY IN DATE, SQL-SERVER

DATEADD(type, value, date)
  • date is the date you want to manipulate
  • value is the integere value you want to add (or subtract if you provide a negative number)
  • type is one of:
    • yy, yyyy: year
    • qq, q: quarter
    • mm, m: month
    • dy, y: day of year
    • dd, d: day
    • wk, ww: week
    • dw, w: weekday
    • hh: hour
    • mi, n: minute
    • ss or s: second
    • ms: millisecond
    • mcs: microsecond
    • ns: nanosecond
SELECT DATEADD(dd, 1, GETDATE()) will return a current date + 1 day