Column Total

bambamn007

New member
Local time
Yesterday, 23:50
Joined
Jan 31, 2003
Messages
6
I am pretty new to DB stuff. But I have learned a bunch about MSDB, and the use with ASP scripting. My question is this. How can I set a field in a DB to total the values of other fields? I think you have to use a pivit table or something, but I don't know anything about this. I am trying to total 2 fields, and have the total appear in 1 filed. Can someone help?
Thanks,
Bam
 
And let me clarify what I need to do. I have website, where members post their matches. It will put in the score field, a 1, 2 or .5, and do the same for their opponent. There are 2 teams so I want a team total for each side. As matches get reported, the table grows vertically. What I want to do, is total all scores for each side. I have the results table set up correctly to do this, I just need the DB to get the sum of the pts column and total it, and the same for the pts2 colums. So those results can go to the correct cell on the table. Did that help?? Or just make it more confusing?
Bam
 
Ok. Since I haven't gotten any replies, let me try to better explain again what I need.

I know this is something simple, at least I think it is.
I have a table with the following columns:

name | score1 | score2 | name2

what I want to do, is to have a field somewhere, that has a total for all numbers in column score, and a field that has a total for all numbers in column score2. how can I do this? I am posting the results to a table on a website that has the total fields at the bottom of the columns.
Any help will be appreciated.
Bam
 
Still not clear what you want.

It is usual to caculate totals in a query, in a control on a form or in a report. Embedding totals in a table is poor practice.

Assuming that your teams can appear on either side of the score table you would need to create two queries, one for each side of the table. These queries will extract the team name and sum the score. To get the totals for both sides to aggregate, you could write a union query.
 
Yes. I got it to work. What I did, was create a query of the sum of score1 and a sum of score2. and placed that query into a table. i tried this before, and it didn't work. i tried the very same thing again, and this time it worked. Go figure. Thanks for the help all.
Bam
 

Users who are viewing this thread

Back
Top Bottom