Query help!

D

deercreek

Is there a way to sum a specific column in a query? What I have is a
query that pulls several line based on a id field. I want to total just
1 column in the query and have it report back as new column. Example

Id Site price date
101 201 40.00 1-11-05
101 404 25.00 1-11-05
101 600 15.00 1-11-05

and I would like to create a new column for total price that would show


Id Site price date totalprice
101 201 40.00 1-11-05 80.00
101 404 25.00 1-11-05 80.00
101 600 15.00 1-11-05 80.00

Can someone explain how to do that? Thanks for help!
 
G

Guest

First I would create a sum query -
SELECT YourTable34.ID, Sum(YourTable34.Price) AS SumOfPrice
FROM YourTable34
GROUP BY YourTable34.ID;

Then the second query with the sum query joined --
SELECT YourTable34.ID, YourTable34.Site, YourTable34.Price,
YourTable34.[Sale Date], SumQuery86.SumOfPrice AS Total
FROM YourTable34 INNER JOIN SumQuery86 ON YourTable34.ID = SumQuery86.ID;
 

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

Query help! 1
Totals Query 2
Query Help - Access 2003 4
Access Running Balance in Access 1
query error 12
Running Balance (Debit and Credit) in Access 2007 4
Grouping - Distinct 5
grouping ... 2

Top