Adding fields in a query

A

Aurora

I am using Access 2003
I have a query for a report that counts Status columns. Ex: Status 10,
Status 20, Status 50. Each quote has status code (depending where the quote
is in our system). My report tells me where the quotes are by status. In my
query I created calculated fields that reads -ID10:
IIf(tableQuotes!statusID=10,1,0). I did this for each status code. Then I
was able to sum the status columns for each sales person. Now I want to add
up all of the Status fields by sales person. So I created another calculated
field in my query - =sum([id10]+[id20]+[id50]). This does not work. I get
the following message. "YOU TRIED TO EXECUTE A QUERY THAT DOES NOT INCLUDE
THE SPECIFIED EXPRESSION 'ID' AS PART OF AN AGRREGATE FUNCTION." I have no
idea what this means or what I have to do to correct the error. Can anyone
point me in the right direction??
aurora
 
A

Al Campagna

Aurora,
I think you might find it easier to just sum the different ID values on the report, in
any "footer" that is appropriate (Report footer or Group footer)
I'll use the Report footer as an example...
Report Footer --------------------------------------------------------------
(Names)
Sum10 Sum20 Sum30 TotIDs
=Sum(ID10) =Sum(ID20) =Sum(ID30) = Sum10 + Sum20 + Sum30

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 

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