I have two tables (free tables) that are exactly the same except for 1 column. I need to calculate this difference and append the column of differences to one of the original files. I'm doing this from Excel VBA.
Here's what I'm trying to do:
SELECT table1.id, (table1.val - table2.val) AS [hf]
FROM table1, table2
WHERE table1.id = table2id; 'works fine for the first 3 lines
ALTER TABLE table3 ADD hf 'table3 is a copy of table1
I've been able to get the differences, but have been unsuccessful in adding it to an existing table.
The error that I'm getting when I add the ALTER line is "[Microsoft][ODBC Visual FoxPro Driver]File must be opened exclusively".
I've played around with USE and SET EXCLUSIVE ON, but can't seem to get it to work. I've also tried INTO instead of ALTER. That ran, but table3 was unchanged.
I'm guessing I need to do some kind of SET EXCLUSIVE and PACK. Any help?
Here's what I'm trying to do:
SELECT table1.id, (table1.val - table2.val) AS [hf]
FROM table1, table2
WHERE table1.id = table2id; 'works fine for the first 3 lines
ALTER TABLE table3 ADD hf 'table3 is a copy of table1
I've been able to get the differences, but have been unsuccessful in adding it to an existing table.
The error that I'm getting when I add the ALTER line is "[Microsoft][ODBC Visual FoxPro Driver]File must be opened exclusively".
I've played around with USE and SET EXCLUSIVE ON, but can't seem to get it to work. I've also tried INTO instead of ALTER. That ran, but table3 was unchanged.
I'm guessing I need to do some kind of SET EXCLUSIVE and PACK. Any help?