Re: Appending crosstab query having dynamic variables
From: Duane Hookom (duanehookom_at_NO_SPAMhotmail.com)
Date: 04/30/04
- Next message: John Vinson: "Re: Complicated Query"
- Previous message: Eric G: "Re: Append Query SQL"
- In reply to: MarkD: "Q: Appending crosstab query having dynamic variables"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 30 Apr 2004 00:38:07 -0500
I'm having trouble determining what you are attempting to accomplish.
--
Duane Hookom
MS Access MVP
"MarkD" <anonymous@discussions.microsoft.com> wrote in message
news:632a01c42e2a$2907d5e0$a301280a@phx.gbl...
> Using Access 2000.
>
> Hi,
>
> I have a crosstab query that has a dynamic variable:
>
> PARAMETERS [age] Short;
> TRANSFORM Sum(IIf(DateDiff("m",[datefirstprrun],
> [maxoftrans_dt])>=[age],1,0)) AS Expr1
> SELECT [Q Raw].Region, [Q Raw].Name1, [age] AS MonthsOld
> FROM [Q Raw]
> GROUP BY [Q Raw].Region, [Q Raw].Name1, [age]
> PIVOT DateDiff("m",#1/1/2003#,[datefirstprrun]);
>
> [Q Raw] is just a query, and [age] is a variable ranging
> from 1-24.
>
> I want to run the above query 24 times, appending the
> results into one giant historical table, changing the
> [age] parameter from 1-24. I'd like to run this in code
> and just have a loop run through 1-24. What I don't know
> how to do is pass the variable to the query. I thought I
> could just pass the whole query (something like "insert
> into [big table] select [xtab query]") but don't really
> know the syntax.
>
> Hopefully that was clear. Any ideas?
>
> In advnace, thanks.
> -Mark
>
>
- Next message: John Vinson: "Re: Complicated Query"
- Previous message: Eric G: "Re: Append Query SQL"
- In reply to: MarkD: "Q: Appending crosstab query having dynamic variables"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|