All Forums Database
Alex181 11 posts Joined 08/14
11 Sep 2014
Convert string to date

Hello,

Can anybody help me convert a string to date format

20130421 convert to 2013-04-21 date format
 
 

 

Raja_KT 1246 posts Joined 07/09
11 Sep 2014

you can use:
select cast(cast('20130421' as date format 'yyyymmdd') as date format 'yyyy-mm-dd');
 

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

Alex181 11 posts Joined 08/14
11 Sep 2014

Thank you! that worked.

You must sign in to leave a comment.