Help - Search - Members - Calendar
Full Version: Time Conversion
Oracle DBA Forums > Oracle > Oracle Forum
Enya
Hello.

I am tyring to covert a time shown as 001200 (12 hours) to 720 mins. I have tried the following but get errors when executing:

(MTTD)>=TO_DATE('000000','HH24:MI:SS').

I have also tried .
MTTD = to_date('000000','HH24:MI:SS') =trunc(sysdate,'MM')*24*60; and neither is working.


What am I doing incorrectly?

Thanks in advance.
burleson
Hi Enya,

You can use a huige number of display transformation for times:

Please Read:

http://www.dba-oracle.com/t_nls_date_format_sysdate.htm

***************************************
>> (MTTD)>=TO_DATE('000000','HH24:MI:SS').

CODE
IF TO_DATE(MTTD)>=TO_DATE('23:11:01','HH24:MI:SS').


You are defining MTTD as a DATE datatype.

You would need a to_char to see the contents of MTTD!

Instead of converting the string to a date, do it the other way around!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.