I need to compare dates in different formats. In the table the field (let's call it revoke_date) is defined as a Date type, and data is stored like 02-Dec-2005.
The application sends in data to the JSP in mm/dd/yyyy format, stored in variable vDate, type String.
How can I do soemthin like "select * from tbl1 where revoke_date = vDate" properly?
posted 9 years ago
Originally posted by gino jersey: (let's call it revoke_date) is defined as a Date type, and data is stored like 02-Dec-2005.
No, no database that I know of stores a date like that, it displays it that way when you look at the data, however every DB I know of stores this as a number value, the number of millisecs (Or whatever it uses, Oracle now uses NanoSec) after an epoc date
Every DB has a function that allows dates to be converted to a Varchar in whatever format you want.