dcount double criteria

B

Boss

What is wrong in this

=DCount("fund","master query","AGE > 100" And "age < 30")

its giving me same result as

=DCount("fund","master query")

Please help

Boss
 
N

nomadk

I think you want your filter criteria wrapped in one set of parentheses. Try:

=DCount("fund","master query","AGE Between 31 and 99")
 
A

akphidelt

What is the result that you are getting?

And I think you should use Or instead of And. It should be

DCount("fund","master query","[age]>100 Or [age]<30")
 
G

George

I concur.

Age can EITHER be greater than 100 (e.g. 110, or 112, or 999) OR less than
30 (e.g. 22, or 18, or 1), but Age for a single record can not be BOTH 110
and 22 at the same time. Therefore DCount("fund","master query","AGE > 100"
And "age < 30") should never return any records because it is impossible for
any age to meet both criteria.

The correct syntax to get a list of ages that fall outside the range of 30
to 100 could be:
DCount("fund","master query","[age]>100 Or [age]<30")
or
DCount("fund","master query","[age] Not Between 30 and 100")

To get a count of ages that fall within the range of 30 to 100, it could be:

DCount("fund","master query","[age] >29 and [age]<101")
or
DCount("fund","master query","[age] Between 30 and 100")

I prefer the "Between" syntax.

George
 
B

Brendan Reynolds

Boss said:
What is wrong in this

=DCount("fund","master query","AGE > 100" And "age < 30")

its giving me same result as

=DCount("fund","master query")

Please help

Boss


Well, first, the "And" should be included within the quotes ...

=DCount("fund","master query","AGE > 100 And age < 30")

Second, that expression will always return zero, as no number can ever be
greater than 100 and less than 30. You probably meant to have the
comparisons the other way around ...

=DCount("fund","master query","AGE < 100 And age > 30")
 
B

Boss

Thanks you all....

Actually the criteria was wrong... its >30 and < 100.

thanks once agian.. this community really really hepls a lot..

Boss
 

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