I found your relative date solution through google, but I don't think I
understand it. Part of my problem is that I need to get 4 weeks- which
need
to be specified before running the query as to track new data and compare
it
to the old.
The query has to do with delivery trucks and fines they incur. The first
few
row headings show the center they belong to, car number, the base month
avg/wk that is calculated in a separate query, then the column headings
come
in for the 4 weeks we want to compare it to (where each weeks fines are
summed), followed by the total of those, the avg/wk, and the % change to
the
base
This is what my SQL looks like:
TRANSFORM Sum([NEW TICKETS].[new fine]) AS [SumOfnew fine]
SELECT [NEW TICKETS].DIVISION, [NEW TICKETS].DM, [NEW TICKETS].CENTER,
[NEW
TICKETS].[CTR NAME], [NEW TICKETS].[CTR MGR], [Top 10 Bases by
Center].CARNO,
[Top 10 Bases by Center].Base, Sum([NEW TICKETS].[new fine]) AS Total,
[Total]/4 AS [Avg Per Week], ([Avg Per Week]/[Base])-1 AS [% Change]
FROM ([NEW TICKETS] INNER JOIN [Current Period Rundates] ON [NEW
TICKETS].RUNDATE=[Current Period Rundates].RUNDATE) INNER JOIN [Top 10
Bases
by Center] ON [NEW TICKETS].CARNO=[Top 10 Bases by Center].CARNO
GROUP BY [NEW TICKETS].DIVISION, [NEW TICKETS].DM, [NEW TICKETS].CENTER,
[NEW TICKETS].[CTR NAME], [NEW TICKETS].[CTR MGR], [Top 10 Bases by
Center].CARNO, [Top 10 Bases by Center].Base
PIVOT Format([Current Period Rundates]!RUNDATE);
The table NEW TICKETS supplies the fine information, the Query Top 10
Bases
by Center is a Union query that combines all the top 10 cars from several
other queries, and the Current Period Rundates table comes from a Make
Table
parameter query so I can set the week ending dates I want. (I give a
beginning and ending and get 4 week ending dates)
I run the dates query and the crosstab in a macro so I can change the
dates
as needed. But as I said, it doesn't change in my report.
Duane Hookom said:
Consider using relative dates/weeks. Search google groups on
relative dates group:*access.Reports* author:hookom
for some information
--
Duane Hookom
MS Access MVP
I have a crosstab query which has Expr1: Format([WEEKENDING]) as its
name.
It
brings up 4 new columns with the different weekending dates as the
title.
I
have this query as the basis of a report (that runs painfully slow),
but
when
I change the weekending dates to a different month in the query, my
report
no
longer works because it doesn't change too.
Is there any way I can get my report to automatically change to match
my
query?