Hi All,
I really need help to figure out why Crosstab query results doesn't match another regular query result with the same parameters.
I am using date range for example 1/1/2011 - 4/30/2014 and the return result looks like following (reports, database was created in Access 2003 and now I am open it in 2010), but if I change date range to
just 4/1/14 - 5/1/14 then I still see the difference:
Badge Valid Void Total Ticks Total Amount
100 29 0 29 $345.00
105 5 0 5 $75.00
crosstab SQL statement;
PARAMETERS [Enter Start Date] DateTime, [Enter End Date] DateTime;
TRANSFORM Nz(COUNT(Master.TickNo),0) AS CountofTicks
SELECT [Shield] AS Badge, Sum(Master.AmtVl) AS SumOfAmount, Nz(COUNT(Master.TickNo),0) AS TotalTicks
FROM Master
WHERE Master.IssDate Between [Enter Start Date] AND [Enter End Date]
GROUP BY [Shield]
PIVOT IIf([DisposCode]="VD","Void","Valid") IN ("Void","Valid");
another query SQL statement the return result below I am using the same date range and Badge "105" and the totals are completely different;
Viol/Code Violation Description Fine Tickets Total Amount
101 Meter Violation $100.00 117 $11,500.00
.... ................. ....... .... .......
Totals: 12538 $206,365.00
SELECT Master.Viol, Violat.Description, Violat.Fine, COUNT(Master.TickNo) AS TotalTickets, Sum(Master.AmtVl) AS SumOfAmount
FROM Master INNER JOIN Violat ON Master.Viol=Violat.Viol
WHERE (((Master.IssDate) Between [Enter start Date] And [Enter end Date]))
GROUP BY Master.Viol, Violat.Description, Violat.Fine
ORDER BY Master.Viol, Violat.Description, Violat.Fine;
There is 2 tables "Master" and "Violat" in the database.
Can somebody help?
thank you,