Count with criteria in a UNION query report

  • Thread starter Thread starter Guest
  • Start date Start date
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!!!
 
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])
 
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
 
Back
Top