Scalar. Returns an integer representing a portion of a date.
datepart ( portion, datevalue )
portion | One of the following strings:
|
datevalue | A date or bigdatetime. |
Returns an integer representing a portion of a date. The portions that the function can return are the year, the month, the day of the year, the day of the month, the day of the week, the hour, the minute, or the second. The function takes a string as the portion argument, and a date or bigdatetime for the datevalue argument. The function returns an integer.
datepart ( 'ss', undate ('2010-03-03 12:34:34')) returns 34.