I know I am doing something stupid and can't put my finger on it.
I am running a query to figure a sales rebate.
Table 1 (simplified) is my customer sales (CS):
Customer name
Sale Date
INV #
ITEM #
Qty Ship
UOM
Alt Qty Ship
Alt UOM
Sale Price
Table 2 (simplified)is an inventory file with only the items that have a rebate amount (REBATE):
ITEM #
Price
Rebate Amount
I want a query that:
Only pulls only records from the sales file that match items in the inventory file - as they are are only ones with a rebate. There are many other items in the customer sales file.
Pulls by specific date
Pulls by specific customer
Pulls the quantity shipped
Pulls the rebate amount
I have linked:
REBATE ----->CS using the ITEM # as the link
CRITERIA:
Item # (because I am triying to identify the problem and it helps to narrow it down to a specific item)
Date: between xx/xx/xxxx and zz/zz/zzzz
SOLD NAME: Like XXXXXXX*
The results I get are duplicating sales. If there is one sale for the customer and item in the time frame - it gives me 5 results that are exactly the same (IE: INV #1235 Qty 8 EA)
There are 4 or 5 sales for the item in the CS file - but outside the timeframe and with different quantities and invoice #'s.
I feel that it is a JOIN problem. I can search either of the tables separately with no problem. I have tried putting the JOINS each way and it doesn't seem to make a difference.
I can alter the tables slightly (add a field if it would correct the join) if needed.
Thanks for your help