YEAR, MONTH, DAY : Day « Date Functions « SQL Server / T-SQL Tutorial






5>
6> SELECT 'Year: ' + CONVERT(VarChar(4), YEAR(GETDATE()))
7>  ', Month: ' + CONVERT(VarChar(2), MONTH(GETDATE()))
8>  ', Day: ' + CONVERT(VarChar(2), DAY(GETDATE()))
9>
10> GO
Msg 102, Level 15, State 1, Server J\SQLEXPRESS, Line 7
Incorrect syntax near '+'.








10.9.Day
10.9.1.Displaying the Integer Value For Part of a Date using DAY
10.9.2.YEAR, MONTH, DAY
10.9.3.select DAY('2002-09-30')