Count with criteria in a UNION query report

G

Guest

I hope this is possible. I have report based on a union query of 3 tables. In the results of that query on the report, I need to count the zip codes into 5 columns
400*, 402*, 471*, then all the others are to be counted together as an Others option - then the final one is to be the count of all of these 4 columns

I'm trying things like =Dcount([zip] if [zip]=400*) but I guess it's reading that the asterick means times and not everything that is 400 and on like 40014, 40015, etc

Any help would be greatly appreciated!!!
 
J

John Spencer (MVP)

DCount takes strings which consist of a fieldname, a table or query name, and a
where clause Without the word where. So your syntax is completely off.

You could try something like:

=Abs(Sum(Left([ZIP],3) = "400"))

=Abs(Sum(Left([ZIP],3) = "402"))

=Abs(Sum(Left([ZIP],3) = "471"))

=Count([Zip]) - Abs(Sum(Left([ZIP],3) = "400")) - Abs(Sum(Left([ZIP],3) =
"402"))- Abs(Sum(Left([ZIP],3) = "471"))

=Count([Zip])
 
G

Guest

John

THANK YOU SO MUCH!!!! I can't tell you how much I appreciate this.

You're wonderful for replying - have a nice holiday weekend. You sure made mine a lot better

Ter
 

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