Multiple Count/Sum Queries

  • Thread starter confused in Access
  • Start date
C

confused in Access

I need to have multiple queries in one report from the same table. I have set
names and numbers required per person that I need to keep track of, but I
need to have a tally of where they are in certain areas, thus the multiple
queries. I need each query to give me the total of what each person has done
so far this year in a certain field and print a monthly report showing the
status of each field. How can I have these run together in a query and create
one report showing all the sums? I don't know how to set up SQL commands.

Thanks.
 
L

LarryP

It may not be the most elegant way, butin situations that sound similar I've
had reasonable success by using IIf statements against the various things
you're trying to count, e.g.:

Sum(IIf(Thing1iswhatIwant,1,0))
Sum(IIf(Thing2iswhatIwant,1,0))
etc.

If you need the actual value and not just a count, replace the 1's with
[TheActualValue] in the IIf statement.
 
C

confused in Access

Where would I put this?

LarryP said:
It may not be the most elegant way, butin situations that sound similar I've
had reasonable success by using IIf statements against the various things
you're trying to count, e.g.:

Sum(IIf(Thing1iswhatIwant,1,0))
Sum(IIf(Thing2iswhatIwant,1,0))
etc.

If you need the actual value and not just a count, replace the 1's with
[TheActualValue] in the IIf statement.


confused in Access said:
I need to have multiple queries in one report from the same table. I have set
names and numbers required per person that I need to keep track of, but I
need to have a tally of where they are in certain areas, thus the multiple
queries. I need each query to give me the total of what each person has done
so far this year in a certain field and print a monthly report showing the
status of each field. How can I have these run together in a query and create
one report showing all the sums? I don't know how to set up SQL commands.

Thanks.
 

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