Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count several colums, one query?

Status
Not open for further replies.

mmasuda

Technical User
Dec 28, 2004
35
US
I am not very experienced in writing queries.
I need to count items in table "Brochures." There are five colums with integer data type.

Example:
Code:
moddrc   sos   tbi   moddrc_sp   sos_sp
100       50     0         0        0
  0      100    25        25        0

I need to find a count for each of the columns and then get a total of all the columns combined. Is there a way to do this in one query?
 
Do you mean you need to sum up the values in each column?

so you will end up with this:

moddrc sos tbi moddrc_sp sos_sp
100 150 25 25 0

?

If so, start a new query, bring in your table.
Go to the menu, pick VIEW+TOTALS.
bring down each field, and change the third row down (the TOTALS row) to SUM instead of GROUP BY.

As for adding up all of them, you can put a calculated field in a query:

=moddrc + sos + tbi + moddrc_sp + sos_sp

Try fiddling around with it a little bit and write back if you need more help.





Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Any questions I see regarding summing across columns/fields rather than across records, raise red flags regarding normalization. I could be wrong since I have no idea what type of information the table is storing and what the field names mean.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
I am not sure about that.
This is what is supposed to happen. Someone calls in and asks to be send information. That person is allowed to request five different items (topic packets)from a list of several hundred. We need to keep track on how many items and which ones were send to each individual.
That is why I would like to put all those five items into one table(tblTopicPacket) which is linked to the caller table. If there is a better way of doing this, please, let me know. I am open to any new ideas. Thanks
 
hmmm......Same thing I said in your last post: thread705-976109

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Boy, I am hitting the panic button.
I had posted two question and now I have them mixed up!!!
I am so sorry.
I have figured out how to do this part. But still stuck on the other
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top