There are several new features in SQL Server 2012 that deal with dates and formatting.
Before 2012, calculating the last day of the month usually involved some sort of hack, like going to the first day of the following month and then subtracting a day.
The new EOMONTH Will take a date or datetime as will return the last day of that month.
returns a date:
This function will return a date from integers representing the year, month and day.
select DATEFROMPARTS(2012, 4, 17)
Returns a date:
Format using .Net format values
select FORMAT(getdate(), ‘MMMM d, yyyy’)
Return a string:
April 17, 2012
FORMAT can also be used with types other than dates
select FORMAT(1, ‘P’)
returns a percentage:
select FORMAT(987.45, ‘C’)
select FORMAT(100, ‘X’)