10 May 2013

Split Year,Month and Day from DateTime Column in SQL Server

Split Year,Month and Day from DateTime Column in SQL Server
Select YEAR(iddate) as [Year],Month(iddate) as [Month],Day(iddate) as date from Excel_Table where iddate!='' order by date Or Select DATEPART(YEAR,iddate) as [Year],DATEPART(Month,iddate) as [Month],DATEPART(Day,iddate) as date from Excel_Table where iddate!=''

No comments: