Hi,
I am stuck at a basic issue related to SQL.
I've a table which stores
date in varchar.
It's has data like this:
Mon Apr 25 08:11:20 GMT 2011
Mon Apr 25 08:14:15 GMT 2011
Mon Apr 25 11:46:00 GMT 2011
Tue Apr 26 09:22:08 GMT 2011
My requirement is to compare dates for two rows.
I could do that in
Java after retriving the data from database using "date" & "string" functions... However I'd like to do that in query (SQL) itself. To do that I need to have this column in date format - I searched on net & found two functions cast & convert, they can convert varchar to date but they need data in a specific format. For example: 20060308000000 or 2006-03-08 00:00:00.
In my case cast or convert functions return null.
Is there anyway I can achive this in SQL?
Is there anyway I can convert varchar (on format 'Tue Apr 26 09:22:08 GMT 2011') to varchar of format which cast or convert expects?
Any other functions I can use here?
Thanks in advance.