aspose file tools
The moose likes JDBC and the fly likes problem with sql query to_date Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "problem with sql query to_date" Watch "problem with sql query to_date" New topic
Author

problem with sql query to_date

Sanny kumar
Ranch Hand

Joined: May 18, 2005
Posts: 53
hi guys,

i want to select the records the records in the table using order by desc clase.

i want to convert the varchar to date.
for example the record inserted like 11/5/2005 08:30 (varchar datatype).
i want to convert the varchar2 to to_date format.
i m using to_date function to convert..but i m getting the error format code apperars twice.

i m getting error when i have records like this

11/18/2005 9:00(mm/dd/yy hh:mm)
11/5/2005 9:21 (mm/dd/yy hh:mm)


any suggestion plz?

Thanks in advance
Santhosh
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Could you please show the query.
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
I really think the best suggestion for you is to convert the varchar field into a date type of field.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: problem with sql query to_date
 
Similar Threads
DB2 Date format to Oracle Date format?
date parse problem
Query giving me two different results
Convert date in difference format
string to date conversion