Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

average time standing

Status
Not open for further replies.

jlindahl

Programmer
Joined
Sep 23, 2003
Messages
46
Location
US
i am using an oracle db. this is my sql stmt.
select avg((to_date('10/23/2003','MM/DD/YYYY') - lastuserdate))
from tablename

my question is, what is exactly happening? i get a result of 400.509981158606....

what i am doing is taking a date column (lastuserdate) and trying to find the average days between lastuserdate and currentdate for all the records. what i don't understand is what is that 400? days?
 
Yes, it's 400+ days. For example

select avg(to_date('23-OCT-03') - to_date('20-OCT-03')) from dual;

will return 3, because there are three days between the two dates.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top