Monday, June 4, 2007

SQL Dateparts and Abbreviations

Table below lists the dateparts and abbreviations recognized by Microsoft SQL Server(MS SQL).
Datepart below is suitable using in DATEADD, DATEDIFF, DATENAME and all Date related function.

DatepartAbbreviations
Yearyy, yyyy
quarterqq, q
Monthmm, m
dayofyeardy, y
Daydd, d
Weekwk, ww
Hourhh
minutemi, n
secondss, s
millisecondms