Presumably you have:
- a Products table (one record per product);
- a Location table (one record per location);
- some kind of sale table (one record for each time a product is sold at a
location).
If you create a query with these 3 tables you only get the records that
exist in the Sale table, i.e. if a product was not sold at a location, you
don't get any record for that combination of Product + Location
1. Create a query containing the Product and Location tables. There will be
no join between them. This gives you every combination of Product and
Location. Save as (say) Query1.
(Technically, this is called a Cartesian product - no join, so it yields
every possible combination.)
2. Create a query into the Sale table.
Depress the Total button on the toolbar (upper sigma icon.) Access adds a
Total row to the grid.
Drag ProductID and LocationID into the grid, accepting Group By under these
fields.
Drag the Quantity field into the grid. Choose Sum under this field.
Set any criteria you want (e.g. the limiting dates under the SaleDate
field), choosing Where in the Total row for these fields.
Save the query as (say) Query2.
(Technically, this is called an outer join.)
3. Create a third query, using both Query1 and Query2 as input "tables".
Drag Query1.ProductID onto Query2.ProductID, so Access shows a join line.
Double-click this line, and choose the option that says:
All records from Query1, and any matches from Query2.
Drag Query1.LocationID onto Query2.ProductID, so Access shows a 2nd join
line. Double-click this line also, and chose the same join type.
The 3rd query shows every combination of product and location (the Cartesian
product), outer-joined to the summary data for the period.