Search code examples
sybaseisql

Converting a date format in sybase


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.


Solution

  • 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)