E
elena
Hi, All
I have a query, all credits to Duane.
I build query from two tables, tblDates has only two fields, where i store
date range
start date and end date.
My problem is that this query doesn't return the same count of tickets, if i
change
date range: example
table has 51 records
date range 11/18/07 - 11/25/07 return 51 tickets (for 11/18 and 11/25 no
tickets at all)
date range 11/19/07 - 11/25/07 return 45 tickets(for 11/25 no tickets) .
table has the same amount of tickets, it is just date range changes.
Please, help how date range effects total count, if table has the same
amount of tickets?
How to fix it?
TRANSFORM Nz(COUNT(TempTicks.TicketNo),0) AS CountofTicks
SELECT [Shield] AS Badge, StartDate, EndDate, Sum(TempTicks.Amount) AS
SumOfAmount, Nz(COUNT(TempTicks.TicketNo),0) AS TotalTicks
FROM TempTicks, tblDates
WHERE TempTicks.IssueDate Between [StartDate] AND [EndDate]
GROUP BY [Shield], StartDate, EndDate
PIVOT IIf([ActCode]="10","Valid","Void") IN ("Valid","Void");
I have a query, all credits to Duane.
I build query from two tables, tblDates has only two fields, where i store
date range
start date and end date.
My problem is that this query doesn't return the same count of tickets, if i
change
date range: example
table has 51 records
date range 11/18/07 - 11/25/07 return 51 tickets (for 11/18 and 11/25 no
tickets at all)
date range 11/19/07 - 11/25/07 return 45 tickets(for 11/25 no tickets) .
table has the same amount of tickets, it is just date range changes.
Please, help how date range effects total count, if table has the same
amount of tickets?
How to fix it?
TRANSFORM Nz(COUNT(TempTicks.TicketNo),0) AS CountofTicks
SELECT [Shield] AS Badge, StartDate, EndDate, Sum(TempTicks.Amount) AS
SumOfAmount, Nz(COUNT(TempTicks.TicketNo),0) AS TotalTicks
FROM TempTicks, tblDates
WHERE TempTicks.IssueDate Between [StartDate] AND [EndDate]
GROUP BY [Shield], StartDate, EndDate
PIVOT IIf([ActCode]="10","Valid","Void") IN ("Valid","Void");