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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -