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

colour text if less than percentage 1

Status
Not open for further replies.

tonyvee1973

IS-IT--Management
Oct 22, 2009
156
0
0
GB
Hi Guys
Have a report in Crystal X1 and a bit stuck.
Have 2 x fields '@physical' which shows physical stock and '@free' which shows free stock.
What i'm trying to do is colour the text red in @free when it is less than 20% of the '@physical' else leave it black.

I've tried the below formula by right clicking the '@loc free' formula, format field, font, then inserting this formukla into the formula box which relates to colour. Needless to say it doesnt work :(

if {@loc free} <20% {@Physical} then crRed
else DefaultAttribute;

Any assistance would be appreciated
 
try this minor change to your logic:

if {@loc free} < ({@Physical} * 0.20) then crRed
else DefaultAttribute;
 
Thanks fisheromacse - worked like a charm! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top