Adding records to a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table consisting of several fields, where one is a customerID. I
would like to repeat all records for one customerID in the table, but
changing the customer ID for the new records. How can I use the query command
to complete ths task?
 
TRANSFORM Sum(Table17.Amount) AS SumOfAmount
SELECT Table17.Building
FROM Table17
GROUP BY Table17.Building
PIVOT Table17.RentOrCam;
 
Hi,


INSERT INTO tableName (CustomerID, listOfOtherFIelds) SELECT 202020, ...,
...., ... FROM existingTable WHERE CustomerID=101010



would insert the records for CustomerID=101010, but with 202020 as
CustomerID value.




Hoping it may help,
Vanderghast, Access MVP
 
Hi,


It can. Use a constant, 202020, rather than a field name, in the first line,
as value, and in the line Append To, use the CustomerID field name. For the
other fields, use, in the first line, the table supplying the values and, in
the Append To line, the field name of the table receiving the new records.



Hoping it may help,
Vanderghast, Access MVP
 
and don't forget to add the criteria for the table supplying new data, it
should be limited to those CustomerID = xyz
 
Back
Top