Ms Milliseconds
Yy Year
Qq Quarter of the Year
Mm Month
Dy The Day of the Year
Dd Day of the Month
Wk Week
Dw The Day of the Week
Hh Hour
Mi Minute
Ss Second
Example-1
Selectdatediff(YY,'2008-06-05','2012-08-05')AsYear
Go
Selectdatediff(Mm,'2008-06-05','2012-08-05')AsMonth
Go
Selectdatediff(Dd,'2008-06-05','2012-08-05')AsDays
Go
Selectdatediff(Wk,'2008-06-05','2012-08-05')AsWeek
Go
Selectdatediff(Dw,'2008-06-05','2012-08-05')As[Day of the Week]
Go
Selectdatediff(Dy,'2008-06-05','2012-08-05')As[Day of the Year]
Go
Selectdatediff(Hh,'2008-06-05','2012-08-05')AsHour
Go
Selectdatediff(Mi,'2008-06-05','2012-08-05')AsMinute
Go
Selectdatediff(Ss,'2008-06-05','2012-08-05')AsSecond