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

formula help

Status
Not open for further replies.

mgossman

Technical User
Apr 20, 2001
18
US
I'm calculating total seconds using the following formula. The formula is working fine. What I'd like to do is set a maximum value of 599, that is, if the result is > 599, I want to set it to 599. Can anyone help?

//calculate incident first on scene response time
//date difference in seconds
Numbervar SecondsBetweenDate := (Date ({incident.arrivaldate}) -
Date ({incident.alarmdate})) * 86400;
//time difference in seconds
Numbervar SecondsBetweenTime := (Time ({incident.arrivaldate}) - Time (0,0,0)) -
(Time({incident.alarmdate}) - Time(0,0,0));
//add date difference and time difference
SecondsBetweenDate + SecondsBetweenTime
 
Why mess with a working formula. I would just create a second formula that said:

If {@formula} > 599
then 599
else {@formula} Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top