Discussion:
combining like orders and then writing to a new table
(too old to reply)
sparks
2014-05-04 21:00:37 UTC
Permalink
customernumber partnum quantity date
1111111 101 1 12/1/2013
2222222 105 1 12/1/2013
1111111 101 5 12/1/2013
1111111 105 1 12/1/2013

I need to get a new table with

customernumber part# quantity date
1111111 101 6 12/1/2013
1111111 105 1 12/1/2013
2222222 105 1 12/1/2013


this seems to work fine
SELECT CustomerOrders.customernumber, CustomerOrders.partnum,
Sum(CustomerOrders.quantity) AS SumOfquantity,
CustomerOrders.orderdate
FROM CustomerOrders
GROUP BY CustomerOrders.customernumber, CustomerOrders.partnum,
CustomerOrders.orderdate;


this is what I was using to write this to a new table

SELECT CustomerOrders.customernumber, CustomerOrders.partnum,
Sum(CustomerOrders.quantity) AS SumOfquantity,
CustomerOrders.orderdate INTO CombinedOrders
FROM CustomerOrders
GROUP BY CustomerOrders.customernumber, CustomerOrders.partnum,
CustomerOrders.orderdate;

this keeps telling me error on line 3

can someone tell me what I am doing wrong?
Erland Sommarskog
2014-05-04 21:09:32 UTC
Permalink
Post by sparks
can someone tell me what I am doing wrong?
What you are doing wrong? You are not giving us the full error message!
That is your mistake.
--
Erland Sommarskog, Stockholm, ***@sommarskog.se
Loading...