Skip to content
Advertisement

how to convert date to a format `mm/dd/yyyy`

I’m having a sql table with date column named CREATED_TS which holds the dates in different format eg. as shown below

Now I want to convert these to format mmddyyyy before as i am comparing the dates in WHERE clause of my SELECT query.

I tried using

but got the result as,

I need the result as eg. 02/20/2012 in order to compare.

Any help will be appreciated.

Advertisement

Answer

As your data already in varchar, you have to convert it into date first:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement