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

Difference between dates in successive records (8.5 SQL)

Status
Not open for further replies.

CarpalT

MIS
Jan 17, 2003
178
US
I have a number of records relating to a customer.
Customer Shipment# Shipdate
A 1 8/1/04
A 2 8/29/04
A 3 9/12/04
C 1 7/5/04
C 1 8/12/04


Etc.
I need to calculate the elapsed time between the shipment dates for each customer. This is probably easy but I'm drawing a blank on it. Any help would be appreciated - thanks!

The world is full of good people.
 
Try:

if {table.customer} = previous({table.customer}) then
datediff("d",previous({table.shipdate}),{table.shipdate}) else 0

-LB
 
Yikes, I should have thought of that! I must still have Christmas Brain. [smile]
Thank you very much!

The world is full of good people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top