These are the datepart
values available to date & time functions:
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 |
NOTE: Use of abbreviations is generally discouraged as they can be confusing (m
vs mi
, ww
vs w
, etc.). The long version of the datepart
representation promotes clarity and readability, and should be used whenever possible (month
, minute
, week
, weekday
, etc.).