DATEPART function in SQL Server

Thursday, 1 December 2011

DATEPART function in SQL Server

This is inbuilt function of SQL-Server.


Syntax


DATEPART ( datepart , date )

Argument


Datepart -  Abbreviations

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

Return Type


int

Example



No comments:

Post a Comment