Have you tried:
INSERT INTO tblXXX(poroduct, jan, feb, mar, apr, may, jun, jul, aug, sep,
oct, nov, dec)
SELECT product, jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec
FROM crosstabQuery
(ie, making it in TWO queries, the saved crosstab and the insert into query)
?
Note that the field name list following tableXXX, tableXXX( ...here... ) ,
have to be made of field defined in tableXXX. I here assumed they where the
same name than for the crosstab.
Hoping it may help
Vanderghast, Access MVP
"AVNN" <AVNN@discussions.microsoft.com> wrote in message
news:17FE9630-5F01-4A99-A30E-CACA7B89C4F5@microsoft.com...
>I am trying to add & distribute yearly sales of an year in to months and
> inserting them in a table. And for all this purpose I am trying to use
> single/one query. I am first using insert into and than using pivot.
>
> On a website I saw the below pivot query and I only added INSERT INTO
> tableXXX of my own,
>
> INSERT INTO tblXXX
> TRANSFORM Sum(Sales) AS [Gross Total]
> SELECT product, FROM tblSales GROUP BY product PIVOT Format(Date,"mmm") In
> "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep", "Oct","Nov","Dec")
>
> But this query generates errors. Can someone please tell how can I use
> INSERT INTO and pivot in the same query.
>
> I would very much appreciate if any can quote an example query.
>
>
> Regards,
>
|