Using DATEADD In SQL Server

Randolph West continues a series on date and time types in SQL Server with the DATEADD function:

As with similar functions, DATEADD can do arithmetic on dates as well as times. The syntax is straightforward:

DATEADD (datepart, number, date)

The number portion must be an integer, and it must be within the acceptable range of values for the date part.

Click through for a few examples.

Related Posts

Custom Power BI Date and Time Formats

Chris Webb continues a series on Power BI custom formats: In my last post I showed lots of examples of how Power BI’s new custom format string feature can be used to format numbers. This post, looking at dates and times, will be a bit different for two reasons: there are a lot more useful examples of […]

Read More

PARSE, CAST, and CONVERT

Max Vernon gives us three ways to change data types: PARSE provides a mechanism to convert a wide variety of character based dates into a datetime data type. From the Docs: Returns the result of an expression, translated to the requested data type in SQL Server. Use PARSE only for converting from string to date/time and number […]

Read More

Categories

November 2018
MTWTFSS
« Oct Dec »
 1234
567891011
12131415161718
19202122232425
2627282930