Posts

Showing posts from November 28, 2010

DATEADD (Transact-SQL)

Image
Returns a specified  date  with the specified  number  interval (signed integer) added to a specified  datepart  of that  date . For an overview of all Transact-SQL date and time data types and functions, see  Date and Time Functions (Transact-SQL) . For information and examples that are common to date and time data types and functions, see  Using Date and Time Data . Transact-SQL Syntax Conventions Syntax Copy DATEADD (datepart , number , date ) Arguments datepart Is the part of  date  to which an  integer number  is added. The following table lists all valid  datepart  arguments. User-defined variable equivalents are not valid. 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 microsecond mcs nanosecond ns number Is an expression that can be resolved to an  int  that is added to a  datepart  of  date . User-defined