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

I want "Ons" and "Offs" to be greater than 30 then highlight yellow

Status
Not open for further replies.

capronton

MIS
Jun 28, 2013
159
0
0
US
If ({@PercentDelta} > .12 or {@PercentDelta} < -.12) and
Sum ({apc_correlated.ons}, {apc_correlated.transit_date_time}, "daily") > 30 and
Sum ({apc_correlated.offs}, {apc_correlated.transit_date_time}, "daily") > 30
then crYellow
else crNoColor

The code above highlights the field yellow if "Ons" or "Offs" are greater than 30.

I want to highlight the field only if "Ons" and "Offs" are greater than 30. Can someone tell me whats wrong with the if statement above?

Thanks for any assistance
 
I guess the important word in your last sentence is ONLY. Right now yellow happens if Percentdelta is in the range. Here is a better statement:

if Sum ({apc_correlated.ons}, {apc_correlated.transit_date_time}, "daily") > 30 or
Sum ({apc_correlated.offs}, {apc_correlated.transit_date_time}, "daily") > 30
then crYellow
else crNoColor

Note the use of OR rather than AND.



Howard Hammerman,
Crystal Training and Crystal Material
On-site classes and one-on-one coaching
Low-cost telephone/email support
 
Great! Thanks Howard, sometimes I get a brain-lock on my AND/OR logic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top