Update/Append Query Problems

Marbinski

Registered User.
Local time
Today, 15:28
Joined
Aug 24, 2004
Messages
45
I was wondering if I was approaching this the right way....
I have 2 tables: TableX and TableX_Import. These are identical tables with the same primary keys and fields.

I am trying to use an append query to add new records from TableX_Import to TableX. After that I use an update query that updates all fields from TableX_Import to TableX.

In the update query: I have values for all fields that look like this:

Field: Value1
Table: TableX_Import
Update to: [TableX].[Value1]

After I run the update query, i look at TableX and none of the values are updated. I'm basically trying to update records with information that was empty with the information from TableX_Import.


Any help or suggestions would be a great help....
 
Try and update statment similair to this to update your rows

update
a
set a.field1 = (select b.field1 from TableX b where b.key1 = a.key1 and b.key2 = a.key2)

You may need to add in some null logic if some fields will not have a value?:
IIf(IsNull([b.field1])=0, b.field1, " ")
 

Users who are viewing this thread

Back
Top Bottom