I have a "working" DSUM that populates a text box on a report. However, it is picking up duplicates and I need to sum only unique rows. I generated a query that will give me what I need, but I can't figure out how to re-write it into a DSUM, incorporating the Group By, so I can throw it into the text box's Control Source.
Any help is much appreciated.
This is the working DSUM (that sums duplicate rows):
Code:
=Nz(DSum("invValue","tblTrackingDelivery","cRecordId="+CStr([cRecordId])+" AND Month(vPayNLTDate) = 11"),0)
This is the query that will give me what I need:
Code:
SELECT tblTrackingDelivery.cRecordId, tblTrackingDelivery.invValue, Month([vPayNLTDate])=11 AS November
FROM tblTrackingDelivery
GROUP BY tblTrackingDelivery.cRecordId, tblTrackingDelivery.invValue, Month([vPayNLTDate])=11
HAVING (((Month([vPayNLTDate])=11)=True));