SyntaxDATEPART ( datepart , date )
Day of the Week
SELECT DATEPART(dw,GETDATE())
YearSELECT DATEPART(yy,GETDATE())
SELECT DATEPART(yyyy,GETDATE())
QuarterSELECT DATEPART(q,GETDATE())
SELECT DATEPART(qq,GETDATE())
Month
SELECT DATEPART(m,GETDATE())
SELECT DATEPART(mm,GETDATE())
Day of the YearSELECT DATEPART(y,GETDATE())
SELECT DATEPART(dy,GETDATE())
Month DaySELECT DATEPART(d,GETDATE())
SELECT DATEPART(dd,GETDATE())
WeekSELECT DATEPART(wk,GETDATE())
SELECT DATEPART(ww,GETDATE())
HourSELECT DATEPART(hh,GETDATE())
MinuteSELECT DATEPART(n,GETDATE())
SELECT DATEPART(mi,GETDATE())
SecondSELECT DATEPART(s,GETDATE())
SELECT DATEPART(ss,GETDATE())
MillisecondSELECT DATEPART(ms,GETDATE())