Home » SQL & PL/SQL » SQL & PL/SQL » getting the date difference in minutes (Oracle 10g Windows)
getting the date difference in minutes [message #414559] Wed, 22 July 2009 11:45 Go to next message
GAN2009
Messages: 25
Registered: January 2009
Location: Phils
Junior Member
Hello Everyone,

I created a form that need to calculate the difference between two dates entered in minutes.

Item: startDate - This is the first date the user will enter. DateTime data type with format MM-DD-YYYY HH24:MI.

Item: EndDate - This is the second date the user will enter. DateTime data type with format MM-DD-YYYY HH24:MI.

Item: Display_DateDiff - This is a display item where the difference between two dates should show up. NUMBER data type.

Example:
StartDate
01-01-2009 23:00

EndDate
01-02-2009 01:10

Display_DateDiff
130

I have search this forum but I could not find anywhere directly related to my problem.

Thank you very much for all your help.

Re: getting the date difference in minutes [message #414560 is a reply to message #414559] Wed, 22 July 2009 11:48 Go to previous messageGo to next message
cookiemonster
Messages: 12422
Registered: September 2008
Location: Rainy Manchester
Senior Member
This should be in the forms or PLSQL forum not here.

This is simple maths
date - date gives difference in days
so multiply that to give minutes.
Re: getting the date difference in minutes [message #414567 is a reply to message #414560] Wed, 22 July 2009 12:45 Go to previous messageGo to next message
GAN2009
Messages: 25
Registered: January 2009
Location: Phils
Junior Member
Thank you for the quick reply even I posted my question in wrong topic. Anyways, your suggestion seems to work perfectly as I needed. Again thank you.
Re: getting the date difference in minutes [message #414569 is a reply to message #414559] Wed, 22 July 2009 12:47 Go to previous message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You didn't search very well.
The difference between 2 dates is in unit of day, there are 1440 minutes par day, so...

Regards
Michel



Ooops! Sorry, cookiemonster, I didn't see your answer.

[Updated on: Wed, 22 July 2009 12:48]

Report message to a moderator

Previous Topic: Per Group ranking - how to continue rank numbers when new rows are inserted in a group?
Next Topic: sql script
Goto Forum:
  


Current Time: Fri Dec 09 05:52:23 CST 2016

Total time taken to generate the page: 0.23070 seconds