I suspect this has something to do with how the joins are set up (I was lazy and let Access make them rather than writing them myself, but it looks ok), but for some reason I don't actually get distinct records, I still get plenty of dupes:
Do I need a rewrite? Sorry, I have no ability to control the lousy fields.
Code:
SELECT DISTINCT mwpax.[Date Modified], mwphy.[First Name], mwphy.[Last Name], mwphy.Code, mwtrn_1.[Procedure Code], mwpro.Description, mwtrn.[Procedure Code], mwpro_1.Description, mwpax.[Payment Amount]
FROM (((mwphy INNER JOIN (mwtrn INNER JOIN mwpax ON mwtrn.[Entry Number] = mwpax.[Payment Reference]) ON mwphy.Code = mwtrn.[Attending Provider]) INNER JOIN mwtrn AS mwtrn_1 ON mwpax.[Charge Reference] = mwtrn_1.[Entry Number]) INNER JOIN mwpro ON mwtrn_1.[Procedure Code] = mwpro.[Code 1]) INNER JOIN mwpro AS mwpro_1 ON mwtrn.[Procedure Code] = mwpro_1.[Code 1]
WHERE (((mwpax.[Date Modified])>=#9/1/2006# AND (mwpax.[Date Modified])<=#9/30/2006#)) AND (mwphy.Code <> '90' AND mwphy.Code <> '96' AND mwphy.Code <> '97' AND mwphy.Code <> '99')
ORDER BY mwphy.[Last Name], mwphy.[First Name], mwtrn_1.[Procedure Code], mwtrn.[Procedure Code] ;