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!

Version 8.0 - How do you compare date fields to one-another

Status
Not open for further replies.

mrspecial

MIS
Apr 19, 2001
2
US
I have 5 different fields that are datetime type. I need to compare each one in a formula. For example if 4 out of 5 are NULL i want the report to return the non-NULL date, or if i have 3-Nulls and 2 dates. I then want to compare the 2 and find the later date of the 2 and return this on the report. Please HELP ASAP ,,,,..........thanks
 
In other words you want the highest of the 5 dates, excluding nulls?

First write a formula for each date:

if IsNull({date})
then Date(1,1,1)
else {date}

Then to find the latest use:

Maximum( [{@date1},{@date2},{@date3},{@date4},{@date5}] ) Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top