Last updated 1 month ago
SQL Server
Azure Synapse Analytics
This function returns an integer representing the specified datepart of the specified date. ().
DATEPART ( datepart , date )
DATE_PART( <date_or_time_part> , <date_or_time_expr> )
Code:
SELECT DATEPART(YEAR, '10-10-2022') as YEAR
Result:
YEAR | -----+ 2022|
SELECT DATE_PART(YEAR, '10-10-2022' :: TIMESTAMP) as YEAR;
No issues were found.
No related EWIs.