Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

DateAdd, DateDiff, and DatePart Functions - SQL Server

RSS
Modified on Thu, Jan 07, 2010, 4:07 PM by Administrator Categorized as SQL Server

Syntax

FunctionSyntaxNotes
DateAddDATEADD(datepart, number, date) 
DateDiffDATEDIFF(datepart, startdate, enddate) 
DatePartDATEPART(datepart, date) 

DatePart Argument

Datepart Abbreviation Functions
day dd, d All functions
dayofyear dy, y All functions
hour hh All functions
ISO_WEEK isowk, isoww New to SQL Server 2008 DatePart function
microsecond mcs New to all SQL Server 2008 functions
millisecond ms All functions
minute mi, n All functions
month mm, m All functions
nanosecond ns New to all SQL Server 2008 functions
quarter qq, q All functions
second ss, s All functions
TZoffset tz New to SQL Server 2008 DatePart function
week wk, ww All functions
weekday dw, w DateAdd and Date Part
year yy, yyyy All functions

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.