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

Capping Field Value

Status
Not open for further replies.

mtownbound

Technical User
Jan 28, 2002
293
US
I'm adding weighting to my issue fields which will cause some of my txtIssueRates to be >100%(It's percentage format so it's really 1). For example, rather than having a 300% Issue Rate, I'd like to cap it so that anything over 100% only shows up as 100%.

Currently, I'm using two fields to accomplish this, which is working, but checking to see if there's a more efficient way of doing it:

[txtIssueRate] =IIf(([txtIssues]=0),0,(([txtLevel3]*10)+([txtLevel2]*5)+([txtLevel1]*1))/[txtIssues])

[txtCapRate] =IIf([txtIssueRate]=0,"0.00%",(IIf([txtIssueRate]>1,"100%",([txtIssueRate]*100 & "%"))))


Thanks
 
I'm not sure why you use this:
[pre][txtCapRate] =IIf([txtIssueRate]=0,"0.00%",(IIf([txtIssueRate]>1,"100%",([txtIssueRate]*100 & "%"))))[/pre]

rather than just
[pre][txtCapRate] = IIf([txtIssueRate]>1,"100%",[txtIssueRate]*100 & "%")[/pre]

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top