In the "WHERE" line, is the part that says "column9" supposed to be 9, 2 or 1?
I tried it on the fly and it says "TABLE1 keyfld" with a text box. Is "keyfld" supposed to be a primary key field name? And what if there isn't a primary key field? I tried to make one and it says "Primary key cannot contain a null value" because some of the records are blank.
Also, what does "foo" mean and do?
Last edited by RBusiness; 02-25-12 at 09:35.
I guess I should explain better! I had field in a table that had multiple image names in it. Each separated by a semicolon and space "; ". I wasn't able to split them up with ease in access so I split them up into different columns (need to) and then imported them into a new table called "ALTIMAGES". I at first didn't include the SKU in the new ALTIMAGES table and now have it set as the primary key.
So what I'm trying to do is copy 16 columns of data from table name ALTIMAGES to table name TABLE2. They share column names for the image data.
Copying From Table "ALTIMAGES"
Copying Column "bsc_alt_img_2"
Copying To Table "TABLE2"
To Column "bsc_alt_img_2"
I set the "sku" column is the primary key in both tables.
I'm doing this for 15 total columns bsc_alt_img_2, bsc_alt_img_3, bsc_alt_img_4 and up to 15.
This is what I have based on your previous instruction.
ON ALTIMAGES.sku = TABLE2.sku
SET TABLE2.bsc_image_alt_2 = ALTIMAGES.bsc_image_alt_2
WHERE TABLE2.bsc_image_alt_2 = 'foo'
On a whim, I thought about the code and thought how the = that is in the WHERE statement when combined with "is null" would be redundant so I removed the = and it worked. The complete working copy for anyone in the future is below.
Thank you SO much for the structure, you have no idea how many hours this took. Over 12 (for a a minute thing) and I'm not kidding! Thank you!
Here's a spin. If I wanted to make this query do the same thing for 14 more columns at the same time how would it look? If you can give me an example for the same TABLES and column names "bsc_image_alt_2" and "bsc_image_alt_3" that would complete my quest! Thank you!!!!!
UPDATE TABLE2 INNER JOIN ALTIMAGES ON ALTIMAGES.sku = TABLE2.sku SET TABLE2.bsc_image_alt_2 = ALTIMAGES.bsc_image_alt_2
WHERE TABLE2.bsc_image_alt_2 is null
I figured it out in Design View by copying things. The only thing I had to do was duplicate the blocks of settings in Design View and then put a [ and ] on the first set of data in the "UPDATE TO" box. I also removed the "Criteria" of "WHERE" like you said and it all works! Thank you VERY much for your help! This has been a thorn in my side for 2 days!