Extract
function is not available in SQL Server 2014? I want to extract year and month form a date or any other. Thanks.
'Extract' function used in oracle. you can use 'DATEPART' or 'YEAR' or 'Month' or 'Day' for extract date details on sql server. try the following T-sql
DECLARE @currentDate DATETIME = GETDATE();
SELECT DATEPART(yyyy, @currentDate);
SELECT DATEPART(mm, @currentDate);
SELECT DATEPART(dd, @currentDate);
SELECT YEAR(@currentDate);
SELECT MONTH(@currentDate);
SELECT DAY(@currentDate);