I have a report that counts the number of Court Cases in a month. The primary key is [CaseNumber], when i run a report to show the charges for that case number, depending on the number of charges that case has tied to it it will count [CaseNumber] that many times. I only need to count [CaseNumber] once. See attached report sample. [CaseNumber] is a unique id as there is no other case that will have the same case number.
I should add that this report is generated from a query (qry_CourtCases) that has a parameter.
-The field [EventDate] has the following criteria in the query Between [StartDate] And [EndDate]
-the [EventType] from table CaseEvent is set to "TJ" or "TC"
-the [JTCT] field from the table Case is set to JT or CT
-the [EventType] from CaseEvent_1 is set to "SE"
SELECT Case.CaseNumber, Case.Specialist, Case.DefLast, Case.DefFirst, CaseCharge.Ct, CaseCharge.Charge, CaseCharge.MiscCode, CaseCharge.Dispo, CaseCharge.DispoRSN, CaseEvent.EventDate, CaseEvent.EventType, CaseEvent.EventOut, Case.JTCT, CaseEvent_1.EventDate
FROM (([Case] LEFT JOIN CaseEvent AS CaseEvent_1 ON Case.CaseNumber = CaseEvent_1.CaseNumber) INNER JOIN CaseEvent ON Case.CaseNumber = CaseEvent.CaseNumber) INNER JOIN (CaseCharge LEFT JOIN ChargeCD ON CaseCharge.MiscCode = ChargeCD.ChargeCode) ON Case.CaseNumber = CaseCharge.CaseNumber
WHERE (((CaseEvent.EventDate) Between [StartDate] And [EndDate]) AND ((CaseEvent.EventType)="TJ" Or (CaseEvent.EventType)="TC") AND ((Case.JTCT)="JT" Or (Case.JTCT)="CT") AND ((CaseEvent_1.EventType)="SE"));