Multiple Count/Sum Queries

G

Guest

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.
 
G

Guest

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.
 
G

Guest

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

Similar Threads

Combine Duplicates in Query 0
Counting multiple memberships 1
SUM in a UNION query 2
Multiple Queries to Multiple Reports 1
Summing multiple fields 2
SQL Union Query help 2
Sum a count total 2
Access Dcount (multiple criteria) 3

Top