Stumped. I have a query using two tables using the following query for a report. I need the tbl_dental_claim.amount_paid. However, when there's more than one duplicate ID in the tbl_claim_line, it's returning the rows which is fine, but it's also multiplying the amount for figure in tbl_dental_claim.amount_paid. How can I avoid this? I do need all the rows, but don't want figures multiplying.
The PK on tbl_dental_claim is ID and PK on tbl_claim_line is line_number (auto).
SELECT DISTINCT tbl_dental_claim.*, tbl_dental_claim.claim_date, tbl_claim_line.*
FROM tbl_dental_claim INNER JOIN tbl_claim_line ON tbl_dental_claim.ID = tbl_claim_line.ID
WHERE (((tbl_dental_claim.claim_date) Between [Forms]![frm_Run_Reports]![txtStartingDate] And [Forms]![frm_Run_Reports]![txtEndingDate]) AND ((tbl_dental_claim.amount_paid)=0) AND ((tbl_dental_claim.form_status)<>4)) OR (((tbl_dental_claim.form_status)<>6));
The PK on tbl_dental_claim is ID and PK on tbl_claim_line is line_number (auto).
SELECT DISTINCT tbl_dental_claim.*, tbl_dental_claim.claim_date, tbl_claim_line.*
FROM tbl_dental_claim INNER JOIN tbl_claim_line ON tbl_dental_claim.ID = tbl_claim_line.ID
WHERE (((tbl_dental_claim.claim_date) Between [Forms]![frm_Run_Reports]![txtStartingDate] And [Forms]![frm_Run_Reports]![txtEndingDate]) AND ((tbl_dental_claim.amount_paid)=0) AND ((tbl_dental_claim.form_status)<>4)) OR (((tbl_dental_claim.form_status)<>6));