A
AVNN
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,
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,