Home » SQL & PL/SQL » SQL & PL/SQL » SYSDATE Minus Minutes
SYSDATE Minus Minutes [message #294150] Wed, 16 January 2008 10:50 Go to next message
amardilo
Messages: 37
Registered: February 2007
Member
Hi there.

I have a PL/SQL procedure that needs to get all fields from a table that were created 25 minutes ago. I know if I do SYSDATE - x (x = value) it will take days away from the current date but how do I do this for minutes and hours?

Anyone know the answer?
Re: SYSDATE Minus Minutes [message #294152 is a reply to message #294150] Wed, 16 January 2008 10:52 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1 hour = 1/24 day
1 minute = 1/1440 day
1 second = 1/86400 day

Regards
Michel

[Edit: change 12 to 24, see below]

[Updated on: Wed, 16 January 2008 10:57]

Report message to a moderator

Re: SYSDATE Minus Minutes [message #294154 is a reply to message #294152] Wed, 16 January 2008 10:55 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
..Unless you live in a time zone where the day has 24 hours. Grin
Re: SYSDATE Minus Minutes [message #294155 is a reply to message #294154] Wed, 16 January 2008 10:56 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Laughing Embarassed

Fixed.
Michel
Re: SYSDATE Minus Minutes [message #294165 is a reply to message #294152] Wed, 16 January 2008 11:28 Go to previous message
amardilo
Messages: 37
Registered: February 2007
Member
Michel Cadot wrote on Wed, 16 January 2008 10:52
1 hour = 1/24 day
1 minute = 1/1440 day
1 second = 1/86400 day

Regards
Michel

[Edit: change 12 to 24, see below]


Thanks for that. Should have known it would be that simple.
Previous Topic: query execution life cycle
Next Topic: ALERT LOGS
Goto Forum:
  


Current Time: Sat Dec 03 10:17:01 CST 2016

Total time taken to generate the page: 0.14004 seconds