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!

Greater than 100%

Status
Not open for further replies.

wv1

Programmer
Feb 12, 2007
6
GB
Hi All
I have a field that calculates a percentage. However i do not want it showing any higher than 100%. Thus if it is calculated at 125% then i simply want to show this result as 100%.

How is this best achieved?

Thanks again
 
You may consider the IIf function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Have looked at that, but cant seem to get it to find anything over >100%...?
 
What is the code you tried to use with IIf function?

Ignorance of certain subjects is a great part of wisdom
 
I was basing it on code I use to pick up nulls and replacing with zeros:

Perfomance: IIf(Nz([Perform],0)=0,0,[Perform])

and trying to change it to >100% then show "100%" else if it is not >100 then just show Perform?

 
Looks like the code you were using is redundant.

NZ([Perform],0) without the IIF would return the same thing.

If you are computing the percent as a ratio of 2 numbers then
Code:
IIF([A]/[B] > 1, 1, [A]/[B]) * 100

If you already have a value
Code:
IIf([Perform]>100, 100, [Perform])
 
ok....

but how do we do this if Perform field is a PERCENTAGE field?

ie. Perform = 114.95%

Thanks again
 
something like this ?
Perfomance: IIf(Nz([Perform],0)>1,1,Nz([Perform],0))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top