Append Query will not work

SteveBreslin

Board Regular
Joined
Jul 23, 2012
Messages
104
Hi all

I wonder if someone can help me, i have three tables of data which i an trying to covert into one master table, i am using an append query , all the heading fields in the souce table and destination table are the same and set up the same, but i keep getting an error saying in column one there is a mismatch, the headings differ.

Has someone come across this before.

Many thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Did you check the Data Type of each field to make sure they match?
Can you attach the SQL code of the Append Query that is not working?
 
Upvote 0
Hi Joe4 see copy of code below

INSERT INTO [Main Changeover Data] ( [Line], [Changeover Start], [Changeover Complete], [Duration], [OEE Target], [Minutes to Reach Target], [OEE Time], [Shift], [Sku], [breaks], [oee_breaks], [Raw_Duration], [CHANGEOVERTARGET], [CHANGEOVERDURATION], [description], [Shop Order 1], [Shop Order 2], [SKU1], [SKU 2], [changeover_id], [DELAY], [NOTE], [OEE_NOTE] )
SELECT [Line 11 Aeon CO data].Line, [Line 11 Aeon CO data].[Changeover Start], [Line 11 Aeon CO data].[Changeover Complete], [Line 11 Aeon CO data].Duration, [Line 11 Aeon CO data].[OEE Target], [Line 11 Aeon CO data].[Minutes to Reach Target], [Line 11 Aeon CO data].[OEE Time], [Line 11 Aeon CO data].Shift, [Line 11 Aeon CO data].Sku, [Line 11 Aeon CO data].breaks, [Line 11 Aeon CO data].oee_breaks, [Line 11 Aeon CO data].Raw_Duration, [Line 11 Aeon CO data].CHANGEOVERTARGET, [Line 11 Aeon CO data].CHANGEOVERDURATION, [Line 11 Aeon CO data].description, [Line 11 Aeon CO data].[Shop Order 1], [Line 11 Aeon CO data].[Shop Order 2], [Line 11 Aeon CO data].SKU1, [Line 11 Aeon CO data].[SKU 2], [Line 11 Aeon CO data].changeover_id, [Line 11 Aeon CO data].DELAY, [Line 11 Aeon CO data].NOTE, [Line 11 Aeon CO data].OEE_NOTE
FROM [Line 11 Aeon CO data];
 
Upvote 0
Did you checks the Data Types in both fields to make sure they match each other?
For example, if the Data Types for the SKU1 field in one table is "Text", but is "Number" in the other table, it will throw an error.

If you cannot figure it out, here is a way of zeroing in on the error.
1. Make a copy of the table you are copying the data into ([Main Changeover Data]). Call it something like [TEMP Main Changeover Data].
2. Now, set up your Append Query to write the data to this TEMP table.
3. Take away one field (probably starting with the last) from your Append Query.
4. Try running the Append Query. If you still get errors, take away another field and try again.
5. Keep doing this until it works. Then, you know that the last field taken away is the culprit!
 
Upvote 0
Thanks for your help i found the problem.
In the query design view i noticed that the line header for each line had [] around the description of the destination table but were not around the headers for the source table, i took these away and it works ok now.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,166
Members
448,870
Latest member
max_pedreira

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top