What I would like to see is each line item connected to the correct Carrier.
What I currently see is every single line item in the line items table listed
for the first carrier, followed by every single line item listed for the
second carrier, and so on. Each line item, regardless of which carrier's
check the items belongs to, is attributed to every carrier, resulting in
multiple incorrect records.
The data in the tables is intact, and the data in each stand-alone query is
intact. This query that is to pull the carrier, statement date and receive
date from the checks table and the group, product code, commission month, and
commission amount from the line items table into one place is intended to be
used as a data pool for reporting. Apparently I have not set something up
correctly, which is why I am seeking help.
FYI, the data was entered through a form "Checks" with a sub-form "Line
Items," as you suggested.
I hope this clarifies what I EXPECT to see. Your experience and expertise
as an MVP are what I EXPECT to learn from. I EXPECT to receive a reply to my
question that will help me learn a little more about this application and how
to use it more effectively. What I don't EXPECT is a condescending tone that
seems intended to make me feel stupid for seeking assistance.
Any practical advice you can offer is very much appreciated. The attitude is
not necessary. If you feel this is beyond your expertise or not worth your
time, perhaps another of your MVP teammates could be of some assistance.
Thank you.
John W. Vinson said:
I have posted it below. Any ideas?
SELECT Checks.CarrierCode, Checks.StmtDate, Checks.RecdDate, [Line
Items].Group, [Line Items].ProdCode, [Line Items].CommMonth, [Line
Items].CommAmt
FROM Checks INNER JOIN [Line Items] ON Checks.ChkID = [Line Items].ChkID
ORDER BY Checks.StmtDate, [Line Items].Group, [Line Items].ProdCode;
This will display each field from Checks as many times as that check has
matches on the ChkID field in LineItems. This is exactly how a query is
designed and intended to work.
What result do you EXPECT? How do you want to see the data? Perhaps you should
consider a Form based on [Checks] with a subform based on [Line Items] if you
want to see each check once, with line items repeated.
John W. Vinson [MVP]