Simple query query

G

Guest

I have two similar queries that updates 2 different fields of the same
tables. How do I combine them into one statement?

I have a macro that runs a query to update a field in my Access table from a
linked table from another database:

UPDATE ItemMaster INNER JOIN AMFLIB_ITEMASA ON
ItemMaster.ITNOIM=AMFLIB_ITEMASA.ITNBR SET ItemMaster.UCDEF =
AMFLIB_ITEMASA.UCDEF;

UPDATE ItemMaster INNER JOIN AMFLIB_ITEMASA ON
ItemMaster.ITNOIM=AMFLIB_ITEMASA.ITNBR SET ItemMaster.whslc =
AMFLIB_ITEMASA.WHSLC;
 
M

Marshall Barton

mslee65 said:
I have two similar queries that updates 2 different fields of the same
tables. How do I combine them into one statement?

I have a macro that runs a query to update a field in my Access table from a
linked table from another database:

UPDATE ItemMaster INNER JOIN AMFLIB_ITEMASA ON
ItemMaster.ITNOIM=AMFLIB_ITEMASA.ITNBR SET ItemMaster.UCDEF =
AMFLIB_ITEMASA.UCDEF;

UPDATE ItemMaster INNER JOIN AMFLIB_ITEMASA ON
ItemMaster.ITNOIM=AMFLIB_ITEMASA.ITNBR SET ItemMaster.whslc =
AMFLIB_ITEMASA.WHSLC;


UPDATE ItemMaster INNER JOIN AMFLIB_ITEMASA
ON ItemMaster.ITNOIM=AMFLIB_ITEMASA.ITNBR
SET ItemMaster.UCDEF = AMFLIB_ITEMASA.UCDEF,
ItemMaster.whslc = AMFLIB_ITEMASA.WHSLC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top