The FORMAT function has been available since 2012. In earlier versions, use this:
DECLARE @d DATETIME = '01/01/2011'; SELECT replace(replace(' '+convert(varchar(10),@d,101),' 0',''),'/0','/')
However, formatting is the job of the front application.
Madhivanan
source share