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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Importing data from one table to another
I have two tables tblmain and tblturnover. The second table tblturnover
includes data for a number of companies for different dates and I want to import the data from tblturnover to tblmain for each compnay. I have tried using an append query but it just adds the data as additional data rather than adding it to the existing compnay records in tblmain. To illusttrate: tblmain txtcompany............txtdate............data1.... ...........data2.........data3.............etc tblturnover txtcompany............txtdate............data1.... ...........data2.........data3.............etc I want to add the values of data1, data2, data3 etc from tblturnover to the fields data1, data2, data3 etc in tblmain where tblmain.txtcompany and tblmain.txtdate equal tblturnover.txtcompanyand tblturnover.txtdate Anyone help? Thanks Tony |
#2
|
|||
|
|||
Importing data from one table to another
When you say "add to", do you mean this is numeric data you want add or text
data you want to concatenate? "Tony Williams" wrote: I have two tables tblmain and tblturnover. The second table tblturnover includes data for a number of companies for different dates and I want to import the data from tblturnover to tblmain for each compnay. I have tried using an append query but it just adds the data as additional data rather than adding it to the existing compnay records in tblmain. To illusttrate: tblmain txtcompany............txtdate............data1.... ...........data2.........data3.............etc tblturnover txtcompany............txtdate............data1.... ...........data2.........data3.............etc I want to add the values of data1, data2, data3 etc from tblturnover to the fields data1, data2, data3 etc in tblmain where tblmain.txtcompany and tblmain.txtdate equal tblturnover.txtcompanyand tblturnover.txtdate Anyone help? Thanks Tony |
#3
|
|||
|
|||
Importing data from one table to another
Sorry for being vague. The fields in tblmain have no data I want to fill
them with the data that is in tblturnover. It is numeric data Thanks Tony "Klatuu" wrote in message ... When you say "add to", do you mean this is numeric data you want add or text data you want to concatenate? "Tony Williams" wrote: I have two tables tblmain and tblturnover. The second table tblturnover includes data for a number of companies for different dates and I want to import the data from tblturnover to tblmain for each compnay. I have tried using an append query but it just adds the data as additional data rather than adding it to the existing compnay records in tblmain. To illusttrate: tblmain txtcompany............txtdate............data1.... ...........data2.........data3.............etc tblturnover txtcompany............txtdate............data1.... ...........data2.........data3.............etc I want to add the values of data1, data2, data3 etc from tblturnover to the fields data1, data2, data3 etc in tblmain where tblmain.txtcompany and tblmain.txtdate equal tblturnover.txtcompanyand tblturnover.txtdate Anyone help? Thanks Tony |
#4
|
|||
|
|||
Importing data from one table to another
All you need is an Update query. In the query builder select the fields you
want to update to and from, and select the company and date in the tables to match in the criteria row. "Tony Williams" wrote: Sorry for being vague. The fields in tblmain have no data I want to fill them with the data that is in tblturnover. It is numeric data Thanks Tony "Klatuu" wrote in message ... When you say "add to", do you mean this is numeric data you want add or text data you want to concatenate? "Tony Williams" wrote: I have two tables tblmain and tblturnover. The second table tblturnover includes data for a number of companies for different dates and I want to import the data from tblturnover to tblmain for each compnay. I have tried using an append query but it just adds the data as additional data rather than adding it to the existing compnay records in tblmain. To illusttrate: tblmain txtcompany............txtdate............data1.... ...........data2.........data3.............etc tblturnover txtcompany............txtdate............data1.... ...........data2.........data3.............etc I want to add the values of data1, data2, data3 etc from tblturnover to the fields data1, data2, data3 etc in tblmain where tblmain.txtcompany and tblmain.txtdate equal tblturnover.txtcompanyand tblturnover.txtdate Anyone help? Thanks Tony |
#5
|
|||
|
|||
Importing data from one table to another
Hi I'm not sure I understand. Could you elaborate because I can't see how I
can put in the second table name in the Update query. What I want is to update tblmain.Data1 with the value of tblturnover.data1, update tblmain.Data2 with the value of tblturnover.data2, update tblmain.Data3 with the value of tblturnover.data3 etc How do I do that? Thanks Tony "Klatuu" wrote in message ... All you need is an Update query. In the query builder select the fields you want to update to and from, and select the company and date in the tables to match in the criteria row. "Tony Williams" wrote: Sorry for being vague. The fields in tblmain have no data I want to fill them with the data that is in tblturnover. It is numeric data Thanks Tony "Klatuu" wrote in message ... When you say "add to", do you mean this is numeric data you want add or text data you want to concatenate? "Tony Williams" wrote: I have two tables tblmain and tblturnover. The second table tblturnover includes data for a number of companies for different dates and I want to import the data from tblturnover to tblmain for each compnay. I have tried using an append query but it just adds the data as additional data rather than adding it to the existing compnay records in tblmain. To illusttrate: tblmain txtcompany............txtdate............data1.... ...........data2.........data3.............etc tblturnover txtcompany............txtdate............data1.... ...........data2.........data3.............etc I want to add the values of data1, data2, data3 etc from tblturnover to the fields data1, data2, data3 etc in tblmain where tblmain.txtcompany and tblmain.txtdate equal tblturnover.txtcompanyand tblturnover.txtdate Anyone help? Thanks Tony |
#6
|
|||
|
|||
Importing data from one table to another
Create a New query
Select tblMain Select tblturnover Create A Join from tblMain.Company to tblturnover.Company Create A Join from tblMain.txtdate to tblturnover.txtdate In your field row Select tblMain.Data1 tblMain.Data3 tblMain.Data3 In your Update To row for Column tblMain.Data1 Enter [tblturnover]![data1] for Column tblMain.Data2 Enter [tblturnover]![data2] for Column tblMain.Data3 Enter [tblturnover]![data3] Now when you run the query, it will update the data in each of the data fields in tblMain to whatever is in each of the data fields in tblturnover Be sure you make a backup before you do this, then check the results. "Tony Williams" wrote: Hi I'm not sure I understand. Could you elaborate because I can't see how I can put in the second table name in the Update query. What I want is to update tblmain.Data1 with the value of tblturnover.data1, update tblmain.Data2 with the value of tblturnover.data2, update tblmain.Data3 with the value of tblturnover.data3 etc How do I do that? Thanks Tony "Klatuu" wrote in message ... All you need is an Update query. In the query builder select the fields you want to update to and from, and select the company and date in the tables to match in the criteria row. "Tony Williams" wrote: Sorry for being vague. The fields in tblmain have no data I want to fill them with the data that is in tblturnover. It is numeric data Thanks Tony "Klatuu" wrote in message ... When you say "add to", do you mean this is numeric data you want add or text data you want to concatenate? "Tony Williams" wrote: I have two tables tblmain and tblturnover. The second table tblturnover includes data for a number of companies for different dates and I want to import the data from tblturnover to tblmain for each compnay. I have tried using an append query but it just adds the data as additional data rather than adding it to the existing compnay records in tblmain. To illusttrate: tblmain txtcompany............txtdate............data1.... ...........data2.........data3.............etc tblturnover txtcompany............txtdate............data1.... ...........data2.........data3.............etc I want to add the values of data1, data2, data3 etc from tblturnover to the fields data1, data2, data3 etc in tblmain where tblmain.txtcompany and tblmain.txtdate equal tblturnover.txtcompanyand tblturnover.txtdate Anyone help? Thanks Tony |
#7
|
|||
|
|||
Importing data from one table to another
Thanks that worked fine!
Tony "Klatuu" wrote in message ... Create a New query Select tblMain Select tblturnover Create A Join from tblMain.Company to tblturnover.Company Create A Join from tblMain.txtdate to tblturnover.txtdate In your field row Select tblMain.Data1 tblMain.Data3 tblMain.Data3 In your Update To row for Column tblMain.Data1 Enter [tblturnover]![data1] for Column tblMain.Data2 Enter [tblturnover]![data2] for Column tblMain.Data3 Enter [tblturnover]![data3] Now when you run the query, it will update the data in each of the data fields in tblMain to whatever is in each of the data fields in tblturnover Be sure you make a backup before you do this, then check the results. "Tony Williams" wrote: Hi I'm not sure I understand. Could you elaborate because I can't see how I can put in the second table name in the Update query. What I want is to update tblmain.Data1 with the value of tblturnover.data1, update tblmain.Data2 with the value of tblturnover.data2, update tblmain.Data3 with the value of tblturnover.data3 etc How do I do that? Thanks Tony "Klatuu" wrote in message ... All you need is an Update query. In the query builder select the fields you want to update to and from, and select the company and date in the tables to match in the criteria row. "Tony Williams" wrote: Sorry for being vague. The fields in tblmain have no data I want to fill them with the data that is in tblturnover. It is numeric data Thanks Tony "Klatuu" wrote in message ... When you say "add to", do you mean this is numeric data you want add or text data you want to concatenate? "Tony Williams" wrote: I have two tables tblmain and tblturnover. The second table tblturnover includes data for a number of companies for different dates and I want to import the data from tblturnover to tblmain for each compnay. I have tried using an append query but it just adds the data as additional data rather than adding it to the existing compnay records in tblmain. To illusttrate: tblmain txtcompany............txtdate............data1.... ...........data2.........data3.............etc tblturnover txtcompany............txtdate............data1.... ...........data2.........data3.............etc I want to add the values of data1, data2, data3 etc from tblturnover to the fields data1, data2, data3 etc in tblmain where tblmain.txtcompany and tblmain.txtdate equal tblturnover.txtcompanyand tblturnover.txtdate Anyone help? Thanks Tony |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Table problem | Redwood | Database Design | 29 | April 3rd, 2006 04:58 PM |
PST file has reached maximum size | Jeff C | General Discussion | 2 | October 6th, 2005 01:35 PM |
Unable to have multiple queries feeding a single report | PZ Straube | Setting Up & Running Reports | 15 | June 15th, 2005 08:16 AM |
strategy for data entry in multiple tables | LAF | Using Forms | 18 | April 25th, 2005 04:04 AM |
Update - If statement | Dan @BCBS | Running & Setting Up Queries | 13 | December 14th, 2004 06:02 PM |