DATEADD function in SQL Server


Function DATEADD returns a new DATETIME value based on adding an interval to the specified date.
The syntax of the DATEADD date function is as follows:
DATEADD(<Datepart>,<Number>,<DATE>)
The <Datepart> parameter specifies on which part of the date to return a new value.
Valid values are
YEAR or YY,
QUARTER or QQ or Q,
MONTH or MM or M,
DAYOFYEAR or DY or Y,
DAY or DD or D,
WEEK or WK or WW,
WEEKDAY or DW or W,
HOUR or HH,
MINUTE or MI or N,
SECOND or SS or S ,
and MILLISECOND or ms.
<Number> use to increment or decrement of <datepart> for new date,
<DATE> parameter is an expression that returns a DATETIME or SMALLDATETIME value.

For Example Click Here

Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...