problem with calculating percentage

  • Thread starter Thread starter smcalles
  • Start date Start date
S

smcalles

I'm working with Access 2003 and am not a programmer.

I've a control with the following control source:
=(DCount("[X]","Y","[X]='1' And [Z]='WT'"))/DCount("[X]","Y","[Z]='WT'")

the format is percent w/ 1 -digit decimal place.

The current values are

(DCount("[X]","Y","[X]='1' And [Z]='WT'")) = 4
DCount("[X]","Y","[Z]='WT'") = 13

(DCount("[X]","Y","[X]='1' And [Z]='WT'"))/DCount("[X]","Y","[Z]='WT'")
should be 30%, but instead I get .8%. Why?
 
Hi,


Something wrong, I suspect a typo of some sort somewhere.

If you do it with 3 columns (in the query grid):

Numerator: DCount("[X]","Y","[X]='1' And [Z]='WT'")


then

Divisor: DCount("[X]","Y","[Z]='WT'")


then, in a third column:

Percent: Numerator / Divisor


do you see 4 for Numerator, 13 for Divisor, and still see .8% for Percent?

If things are ok, doing it this way, then there is probably a typo in your
original work.



Vanderghast, Access MVP
 
Back
Top