Welcome Guest ( Log In | Register )


 
 
 
 
 
 

 
 
Oracle 

Performance Tuning Reference poster
 
Oracle training in Linux 

commands
 
Oracle training Weblogic Book
 
Easy Oracle Jumpstart
 
Oracle training & performance tuning books
 
Burleson Consulting Remote DB Administration
 
 
 
Reply to this topicStart new topic
> Time Conversion
Enya
post Feb 10 2012, 08:47 PM
Post #1


Newbie
*

Group: Members
Posts: 5
Joined: 9-January 12
From: California
Member No.: 46,549



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.
Go to the top of the page
 
+Quote Post
burleson
post Feb 11 2012, 06:02 AM
Post #2


Advanced Member
***

Group: Members
Posts: 11,508
Joined: 26-January 04
Member No.: 13



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!


--------------------
Hope this helps. . .

Donald K. Burleson
Oracle Press author
Author of Oracle Tuning: The Definitive Reference
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 23rd September 2014 - 03:22 PM