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
Comments
Please sign in to leave a comment.