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!

Need help with Max date, date difference

Status
Not open for further replies.

ld66

Technical User
Jun 15, 2004
2
US
I have a report that calculates the last time a report was submitted and the last event that was logged in the report. For example:

Contact Report Submitted Last Event

A 8/1/04 7/15/04
B 8/15/04 4/15/04

I need to determine the number of days between the Last Event and The Report Submitted. Both fields are summary fields (max report submitted and Max last event).

I am using Crystal 9. Thanks!
 
DateDiff("d", date1, date2) ought to do it. I've not tried using it with summaries, but if it refuses to use them, create running totals with the [maximum] as the type of summary.

Madawc Williams (East Anglia)
 
Thanks! I tried the first and it gave me an error, but the running summary worked. Thank you!
 
You should also be able to use the following:

datediff("d",maximum({table.reptsub},{table.groupfield}),
maximum({table.lastevent},{table.groupfield}))

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top