Click to Rate and Give Feedback

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
SQL Server 2005 Books Online (November 2008)
DATEADD (Report Builder)

Updated: 12 December 2006

Returns a datetime that is the result of adding the specified number of time interval units to the original datetime.

DATEADD(interval, units, datetime)

interval

Specifies the units (year, quarter, month, day, hour, minute, second or week) used to calculate the date addition.

units

Specifies the number of intervals.

datetime

Specifies the date to which the intervals are added.

  • Intervals are not case-sensitive.

The following intervals are valid.

Interval Result

YEAR

Returns a date that is the number of years specified from the datetime.

QUARTER

Returns a date that is the number of quarters specified from the datetime.

MONTH

Returns a date that is the number of months specified from the datetime.

WEEK

Returns a date that is the number of weeks specified from the datetime.

DAY

Returns a date that is the number of days specified from the datetime.

HOUR

Returns a date that is the number of hours specified from the datetime.

MINUTE

Returns a date that is the number of minutes specified from the datetime.

SECOND

Returns a date that is the number of seconds specified from the datetime.

Formula Result

DATEADD(MONTH, 3, #8/18/2009#)

11/18/2009

DATEADD(DAY, 365, Sell End Date)

Returns a sell end date for each instance that is 365 days from the original sell end date. For example, if the original sell end date is 12/18/2009, the result is 12/18/2010.

Release History

12 December 2006

Updated content:
  • Quotation marks are no longer required for intervals.

14 April 2006

New content:
  • Added Remarks section.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Incorrect Documentation      MrDerikart   |   Edit   |   Show History
I just tried the value DAY for the DateInterval object. It did not work. However, using "d" for the value did work. Please correct this documentation.
Tags What's this?: Add a tag
Flag as ContentBug
DATEADD (Report Builder) Mis-Information      Tigris   |   Edit   |   Show History
Thanks MrDerikart, I appreciate the insight... saved me some headaches. Can someone please correct the misinformation?
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker