Need help w/ expression

T

Tom

I need some help w/ the expression below:

Average: Round(Sum([Score]/[Counter]),1)

Currently, the query pulls the following records:

Sum Counter Average
200 2 100
0 3
590 7 84.3
200 4 50


The 2nd record (0, 3) does not give me the expected value of "0" for the
Average column.

How can I modify the "Average" expression to show the zero value?


Thanks,
Tom
 
W

Wayne Morgan

Should it be?
Average:Round(Sum([Score])/[Counter], 1)

Is the zero really a zero or are there Null values? If the latter,
Average:Round(Nz(Sum([Score]), 0)/[Counter], 1)
 
T

Tom

Wayne:

Thanks, that did the trick!!!

And, yes, you're right... they were NULLs...

Again, thanks,
Tom



Wayne Morgan said:
Should it be?
Average:Round(Sum([Score])/[Counter], 1)

Is the zero really a zero or are there Null values? If the latter,
Average:Round(Nz(Sum([Score]), 0)/[Counter], 1)

--
Wayne Morgan
MS Access MVP


Tom said:
I need some help w/ the expression below:

Average: Round(Sum([Score]/[Counter]),1)

Currently, the query pulls the following records:

Sum Counter Average
200 2 100
0 3
590 7 84.3
200 4 50


The 2nd record (0, 3) does not give me the expected value of "0" for the
Average column.

How can I modify the "Average" expression to show the zero value?


Thanks,
Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top