SELECT DATEPART(yyyy,OrderDate) AS OrderYear, DATEPART(mm,OrderDate) AS OrderMonth, DATEPART(dd,OrderDate) AS OrderDay, FROM Orders WHERE OrderId=1
Declare @date varchar(50) set @date=cast(month('15-Feb-2012') as nvarchar(50)) Select @Date
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)