Help for an access Newbie

Chackett

New Member
Joined
Jul 29, 2004
Messages
24
I have an .MDB set up with two tables. One table is the general ledger, with three fields that I am interested in
1. Entity
2. Account
3. Cost Center
The Second has two fields I am interested in:
1. Entity
2. product type

There are several entities in each of 4 product types, I esentially want a query that will tell me how many times an account/cost center combo appears in the general ledger for each product type.

Can anyone help? Thanks!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi

Are there multiple entries for the same "Entity" in the ledger table? What about in the second table?

Martin
 
Upvote 0
In the ledger there are multiple account/cost center strings used for each entity. The second table relates an entity to a product type. Each entity is associated with only one product type, each product type will contain multiple entities.

Thanks for the help!
 
Upvote 0
Hi

Does this do the job for you?

Code:
SELECT DISTINCTROW SecondTable.ProductType, ledger.Entity, ledger.Account, Count(ledger.CostCentre) AS CountOfCostCentre
FROM SecondTable LEFT JOIN ledger ON SecondTable.Entity = ledger.Entity
GROUP BY SecondTable.ProductType, ledger.Entity, ledger.Account, SecondTable.Entity;
Martin
 
Upvote 0

Forum statistics

Threads
1,224,315
Messages
6,177,845
Members
452,810
Latest member
jeffrey0409

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top