SQL SERVER DATEADD function

definition:

The DATEADD () function plus the date specified in the time interval.

※ specified time interval can be negative

grammar:

DATEADD(datepart,number,date)

parameter:

the datepart of a parameter can be the following values:

datepart abbreviation
year yy, yyyy
Quarter qq, q
month mm, m
On the day house, the
day dd, d
week wk, ww
week dw, w
hour hh
minute me n
second ss, s
millisecond ms
subtle mcs
Ns ns

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Number The is the time interval you want to add. Can be positive, it can be negative.

DATE parameter is valid date expression.

Example:

 

Guess you like

Origin www.cnblogs.com/feiyu721/p/11236144.html