I have an totals query being driven by aother query with a number of fields. Two of the records in the source query are exactly the same except for one field. The totals query only uses four of the fields, none of which are the one field that has different values in these two records. The totals query is counting both of these records instead of just one and the value field is being added twice. The UniqueValues property is set to "Yes" in the totals query. Also, when the totaling is turned off, it only sees one of the records.
So I assume that in the totaling mode, it does its totaling and then looks for duplicate records. Is there any way to set this up to look for the duplicate records before doing the totaling?
Here is the SQL:
SELECT DISTINCT qry8570CurBrokSalesDays.ReportingDivisionNo, qry8570CurBrokSalesDays.RegionalBroker, Count(qry8570CurBrokSalesDays.Sale_No) AS CntOfSales, Sum(qry8570CurBrokSalesDays.DaysListToAcc) AS TotOfDays
FROM qry8570CurBrokSalesDays
GROUP BY qry8570CurBrokSalesDays.ReportingDivisionNo, qry8570CurBrokSalesDays.RegionalBroker
HAVING (((qry8570CurBrokSalesDays.RegionalBroker) Is Not Null));
So I assume that in the totaling mode, it does its totaling and then looks for duplicate records. Is there any way to set this up to look for the duplicate records before doing the totaling?
Here is the SQL:
SELECT DISTINCT qry8570CurBrokSalesDays.ReportingDivisionNo, qry8570CurBrokSalesDays.RegionalBroker, Count(qry8570CurBrokSalesDays.Sale_No) AS CntOfSales, Sum(qry8570CurBrokSalesDays.DaysListToAcc) AS TotOfDays
FROM qry8570CurBrokSalesDays
GROUP BY qry8570CurBrokSalesDays.ReportingDivisionNo, qry8570CurBrokSalesDays.RegionalBroker
HAVING (((qry8570CurBrokSalesDays.RegionalBroker) Is Not Null));