DATEADD function in SQL Server

Saturday, 3 December 2011

DATEADD function in SQL Server

Syntax

DATEADD (datepart , number, date )

Arguments

Datepart-  Abbreviations
year-   yy, yyyy
quarter-  qq, q
month-  mm, m
dayofyear- dy, y
day-  dd, d
week-  wk, ww
weekday-  dw, w
hour-  hh
minute-  mi, n
second-  ss, s
millisecond- ms

Retun Type

Returns datetime, but smalldatetime if the date argument is smalldatetime.

No comments:

Post a comment