but this can't,
orcl> select cast(systimestamp as date) from dual; CAST(SYSTIMESTAMP ----------------- 11-01-13 15:45:38
orcl> select cast(to_timestamp(systimestamp, 'MM/DD/YYYY hh:mi:ss.ff PM') as date) from dual; select cast(to_timestamp(systimestamp, 'MM/DD/YYYY hh:mi:ss.ff PM') as date) from dual * ERROR at line 1: ORA-01858: a non-numeric character was found where a numeric was expected
malky wrote:notice that DATE datatype does not contain any fractions of a second.
01/11/2013 10:47:55 AM
malky wrote:Well, what you are doing is trying to convert a string into a timestamp, and then convert the timestamp to a date. Which works, if you pass a string.
Yes it is a timestamp column...
So ok, that's how I read online I could convert a timestamp to date..
if that's not the case... then how do i return a timestamp column as a date?I've already shown you in my sample code!
I was trying to_date but there's no formatting for milliseconds hence why everyone suggests using to_timestamp... and if that doesn't work then what can I do? WL10 doesn't convert timestamps to java.sql.Date, so I need from the query to give it a Date instead of a timestamp.