Avatar of gigifarrow
gigifarrow
 asked on

Dividing using DCount

This code divides the answer by 11
 I need to divide 11 by the answer. How do I do that?
for example instead of 2 / 11
 
I need it to show 11/2

=DCount("*","tblMODHistory","[Div] = '170-HBCT'")/11 & "%"
Microsoft Access

Avatar of undefined
Last Comment
pteranodon72

8/22/2022 - Mon
IrogSinta

Wouldn't that just be =11/DCount("*","tblMODHistory","[Div] = '170-HBCT'") & "%"
gigifarrow

ASKER
That doesnt work.
mbizup

Does that mean you get an error, or that you get unexpected results?


Try this:
=(11/iif(DCount("*","tblMODHistory","[Div] = '170-HBCT'") =0,1, DCount("*","tblMODHistory","[Div] = '170-HBCT'"))) & "%"

Open in new window

Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
pteranodon72

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
gigifarrow

ASKER
Good job!

pT72
pteranodon72

Scratch that about operator precedence. All arithmetic operators go before concatenation.