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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

average days between two dates

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
US
I have a script to get the days between an order date and a fill date. something like:

select
transid,
trans_date a,
trans_date b,
b.trans_date - a.trans_date
from
transactions a,
transactions b
where
a.transid = b.transid

I tried to turn this into a group select and ave the days between the two dates, so I can check the ave for a given year or month, but no matter how I group it, I cant get the numbers to work out. I need to product something like:

2001/01 15
2001/02 12
2001/03 14
etc
etc
2001/12 12
____
2001 13.5

any help would be greatly appreciated

 
Never mind, I finally got the right combination of group bys and got it to work...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top