Basic Question About Queries Tab

G

Guest

Is there a way to make subtotals in Access if no primary key is assigned.
For example: Bob and Sharon share a cash register. I have a spreadsheet with
both of there names hundreds of times in column "A". I have the amount they
charged at transaction in column "B". Is there a way to show Bobs name once
and Sharon's name once with a grand total of all the money they have charged?

Any help appreciated.
 
J

JohnFol

Yes, but you don't explain what you are using to show the grand total. I
will presume it's a Form or Report.

Have a look at
DSum ("TransactionCharge", "TransactionsTable")

and also
RunningSum
 
B

Brian

The parawon said:
Is there a way to make subtotals in Access if no primary key is assigned.
For example: Bob and Sharon share a cash register. I have a spreadsheet with
both of there names hundreds of times in column "A". I have the amount they
charged at transaction in column "B". Is there a way to show Bobs name once
and Sharon's name once with a grand total of all the money they have charged?

Any help appreciated.

Assuming that you have the table in Access (either linked to, or imported
from, your spreadsheet), that it's called "Cash", and it has fields "Person"
and "Amount", then this query will do it for you:

SELECT Person, SUM(Amount) PersonTotal FROM Cash GROUP BY Person
 

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