DATEPART (datepart, date)

Returns a value corresponding to the datepart requested from the given date.

Example:

DATEPART ( h, getdate() )

returns the current hour of the current datetime.

Valid dateparts are d,dd,m,mm,q,y,yy,yyyy,h,hh,n,s

See also: DATEADD, DATEDIFF, DATEFIFFMILLISECOND, DATESERIAL

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.