Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append to single column

Status
Not open for further replies.
Feb 25, 2008
46
US

I have two tables: A and B

I would like to append data from one column in Table A to one column in Table B.

The Primary key in Table A is the Foreign Key in Table B.

Is this possible?

Thanks for your help.

Mark.

 
Do you mean update an existing column, add another column or add records?
 
I would like to append data from one column in Table A to one column in Table B.
Why? It sounds like you already have the data. Use a query with a join to retrieve it rather than duplicating data across multiple tables (rarely a good idea).

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 


Remou, traingamer,


Thanks for your response.

Table A has the corrected data which needs to replace data in Table B for a particular date range.

Table A has columns: Date, Employee Number (PK), Production units.

Table B has columns: Date, Employee Number (FK), Production units, hours worked, Line.

I need to replace the data in 'production units' column of Table B with corrected data in 'production units' column of Table A on a weekly basis.

I do not wish to change data in any other columns in Table B.

I have tried the append query but it isn't working.

Thanks for your inputs,

Mark.
 
If this is something that has to be done on a weekly basis, it would be best to go with traingamers suggestion, that is, use a query that shows the data:

Code:
SELECT tblB.Date, 
       tblB.EmployeeNumber,
       tblA.ProductionUnits,
       tblB.HoursWorked,
       tblB.Line
FROM tblB 
INNER JOIN tblA
ON tblB.EmployeeNumber=tblA.EmployeeNumber

Or there abouts. If you really must change the data, you need an Update query, not an Append query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top