I need to convert May 8 2014 to this format 08/05/2014.
I tried using:
convert(char(12),"May 8 2014",103)
but it did not work.
Kindly suggest a workaround.
I need to convert May 8 2014 to this format 08/05/2014.
I tried using:
convert(char(12),"May 8 2014",103)
but it did not work.
Kindly suggest a workaround.
Try to convert the string to datetime, and than you should convert it to char as below:
select convert(char(12),cast("May 8 2014" as datetime) ,103)
Another implementation of same approach , i.e., first convert to datetime:
select convert(char(12),convert(datetime,"May 8 2014") ,103)