Dateparts and Abbreviations
Datepart Abbreviation
year yy, yyyy
quarter qq, q
month mm, m
dayofyear dy, y
day dd, d
week wk, ww
weekday dw
hour hh
minute mi, n
second ss, s
millisecond ms
Related examples in the same category
1. | DATEPART: return part of a date as an integer value | | |
2. | select DATEPART(weekday, '2002-09-30 11:35:00') | | |
3. | select DATEPART(week, '2002-09-30 11:35:00') | | |
4. | select DATEPART(quarter, '2002-09-30 11:35:00') | | |
5. | select DATEPART(dayofyear, '2002-09-30 11:35:00') | | |
6. | DATEPART(m,GETDATE()) | | |
7. | DATEPART(dw,GETDATE()) | | |
8. | DATEPART(yy,GETDATE()) | | |
9. | DATEPART(wk,GETDATE()) | | |
10. | DATEPART(n,GETDATE()) | | |
11. | DATEPART(mi,GETDATE()) | | |
12. | DATEPART(month, '4-29-1988') | | |