Shen
asked on
ms access query update
I am trying to set an ms access query to update different fields in a table based on different values in another table. If i run it the update below if erases the previous set values. Is there a way to nest these expression so that they only execute the condition when is true.
UPDATE [table1] INNER JOIN table2 ON [table1].field1 = table2.field1
SET
table1.field10 = IIF(table2.fieldz=17,-1),
table1.field11 = IIF(table2.fieldz=18,-1),
table1.field12 = IIF(table2.fieldz=19,-1),
table1.field13 = IIF(table2.fieldz,30,-1,II F(table2.f ieldz,44,- 1,IIF(tabl e2.fieldz, 141,-1)))
WHERE table1.fieldB=2 ;
UPDATE [table1] INNER JOIN table2 ON [table1].field1 = table2.field1
SET
table1.field10 = IIF(table2.fieldz=17,-1),
table1.field11 = IIF(table2.fieldz=18,-1),
table1.field12 = IIF(table2.fieldz=19,-1),
table1.field13 = IIF(table2.fieldz,30,-1,II
WHERE table1.fieldB=2 ;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
You're welcome:)
ASKER
Thank you