Mega Code Archive
Categories
/
MSSQL Tutorial
/
Date Functions
DATEPART returns part of a date as an integer value
The syntax for DATEPART is: DATEPART(part_of_the_date_to_return, the_date) 19> 20> SELECT DATEPART(dw,GETDATE()) 21> GO ----------- 1 (1 rows affected)