ValueExplanation year, yyyy, yy Yearquarter, qq, qQuýmonth, mm, mThdaydayofyearDate in daysday, dy, yYdayweek, ww, wkTuwwdayday, dw, w Day of the day, hhGinminute, mi, nPhútsecond, ss, s Millisecond, msMis second
number: the amount of time you want to add.
thoigian: the amount of time you want to add numbers .
Note :
If the number parameter > 0 , DATEADD function will understand that this is the number of times to be incremented and added to thethoigianparameter.
If the number <0 parameter, DATEADD function will understand this is the number of times you want to reduce and subtract from thethoigianparameter.
If the number parameter is in decimal , DATEADD will only use the integer part (remove the decimal part).
DATEADD can be used in later versions of SQL Server: SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, and SQL Server 2005.
For example
Take a look and explore some examples of DATEADD functions in SQL Server.