sql server - Convert date formatted as numeric without leading 0 for months < 10 to date format t-sql -
have date field need convert mddyy or mmddyy (numeric format) when month >=10 mmddyy date format. have yet find answers on web.
you can use format:-
format ( table.mydatecolumn, 'd', 'en-us' )
edit:-
try this:-
select ltrim(str(month(datecolumn)))+'/'+ltrim(str(day(datecolumn)))+'/'+str(year(datecolumn),4)
Comments
Post a Comment