Home » SQL & PL/SQL » SQL & PL/SQL » NUMBER OF DAYS BETWEEN DATES (ORACLE 10G)
NUMBER OF DAYS BETWEEN DATES [message #324001] Fri, 30 May 2008 04:31 Go to next message
ravi214u
Messages: 153
Registered: February 2008
Location: CANADA
Senior Member
Hi

i know this query to find the number of days between dates.

select startdate - end_date as no_of_days from dual

Any one have any other query or this one is fine.
Re: NUMBER OF DAYS BETWEEN DATES [message #324003 is a reply to message #324001] Fri, 30 May 2008 04:40 Go to previous messageGo to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
your querry will return negative values
Re: NUMBER OF DAYS BETWEEN DATES [message #324008 is a reply to message #324001] Fri, 30 May 2008 04:51 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

select end_date - start_date
from dual. ..
then it will return positive value..
Re: NUMBER OF DAYS BETWEEN DATES [message #324012 is a reply to message #324001] Fri, 30 May 2008 04:56 Go to previous message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I say it is OK.
But of course, I'm not responsible of the error you can have in your results.

Regards
Michel
Previous Topic: Marked killed sessions and forms not terminated
Next Topic: How can i display array values in PL/SQL prorgam
Goto Forum:
  


Current Time: Wed Dec 07 03:09:28 CST 2016

Total time taken to generate the page: 0.19787 seconds