Finding Differences between sums

A

Amir

Hi! I'll be glad if you could help me with the following:

I have 2 tables:

tblReceiptEvents:
--------------------
ReceiptEventID (PK)
ReceiptID
ProductKey
QuantityInReceipt
DeliveryPageID

tblDeliveryPagesEvents
---------------------------
DeliveryPageID (PK)
ProductKey
QuantityInDeliveryPage

I want to know for each ProductKey,
the difference between it's quantity (summed up) in the table 1,
and it's quantity (summed up) in table 2.

The purpose is to look for "mismatches" between the sums
in the *linked* tables, so I want the query to "search"
for differences in receipts and delivery pages that are
linked with the SAME DeliveryPageID value, and show
them seperately from differences in receipts and delivery
pages linked with other DeliveryPageID value.

Thank you very much for your help!!

Amir.
 

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