A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding records to a table



 
 
Thread Tools Display Modes
  #1  
Old September 8th, 2005, 07:50 PM
Petterq
external usenet poster
 
Posts: n/a
Default Adding records to a table

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?
  #2  
Old September 8th, 2005, 09:19 PM
KARL DEWEY
external usenet poster
 
Posts: n/a
Default

TRANSFORM Sum(Table17.Amount) AS SumOfAmount
SELECT Table17.Building
FROM Table17
GROUP BY Table17.Building
PIVOT Table17.RentOrCam;


"Petterq" wrote:

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?

  #3  
Old September 8th, 2005, 09:34 PM
Michel Walsh
external usenet poster
 
Posts: n/a
Default

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


"Petterq" wrote in message
...
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?



  #4  
Old September 8th, 2005, 09:37 PM
Petterq
external usenet poster
 
Posts: n/a
Default

Hello.

So this has to be programmed in SQL? I can not use the add records query?


"Michel Walsh" wrote:

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


"Petterq" wrote in message
...
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?




  #5  
Old September 8th, 2005, 09:49 PM
Michel Walsh
external usenet poster
 
Posts: n/a
Default

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



"Petterq" wrote in message
...
Hello.

So this has to be programmed in SQL? I can not use the add records query?


"Michel Walsh" wrote:

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


"Petterq" wrote in message
...
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?






  #6  
Old September 8th, 2005, 09:55 PM
Michel Walsh
external usenet poster
 
Posts: n/a
Default

and don't forget to add the criteria for the table supplying new data, it
should be limited to those CustomerID = xyz



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access combo box-show name, not ID, in table? write on New Users 30 April 30th, 2005 09:11 PM
adding records from another table via SQL Mk. II TB General Discussion 7 March 29th, 2005 06:24 AM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Table Wizard Does Not Set Relationship if Foreign Key and Primary Key Name Do Not Match Exactly in Case. HDW Database Design 3 October 16th, 2004 03:42 AM
COMPARE THE TWO TABLES Stefanie General Discussion 0 June 4th, 2004 04:36 PM


All times are GMT +1. The time now is 08:56 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.