DECLARE @d DATETIME = '01/01/2011';
SELECT FORMAT ( @d, 'd', 'en-US' ) AS US_Result;
I am using above code in SQL Server 2008 R2 but it is encountering an error:
‘FORMAT’ is not a recognized built-in function name.
How can I use FORMAT function?
FORMAT function is available from version 2012 onwards. In earlier versions, use this:
However, formatting is the job of the front end application.