Need help building query

G

Guest

I'm not that familiar to Access and would appreciate some help building the
following SQL query.

I have two tables, and if two categories match within the tables, then I
would like a third category entry updated to the first table.

1st Table: Working
2nd Table: Original

Categories (columns) that should match between table 1 and 2:
Pt Acct #
Charge Cd

If the entires for a line match, then update: Lawson #
(take from Original table and enter into line for Working table)

So, basically if the (Pt Acct #) AND (Charge Cd) in the (Original) table
match the (Pt Acct #) AND (Charge Cd) in the (Working) table , then take the
(Lawson #) from the (Original) table and update it to the (Lawson#) entry in
the (Working) table.

Please Help,
 
K

Ken Snell \(MVP\)

Perhaps this (always make backup copy of your data before running an update
query that is "in test" mode):

UPDATE Working
INNER JOIN Original
ON Working.[Pt Acct #] = Original.[Pt Acct #]
AND Working.[Charge Cd] = Original.[Charge Cd]
SET Working.[Lawson #] = Original.[Lawson #];
 
G

Guest

THANK YOU!! It worked perfectly.
--
Anna Marie


Ken Snell (MVP) said:
Perhaps this (always make backup copy of your data before running an update
query that is "in test" mode):

UPDATE Working
INNER JOIN Original
ON Working.[Pt Acct #] = Original.[Pt Acct #]
AND Working.[Charge Cd] = Original.[Charge Cd]
SET Working.[Lawson #] = Original.[Lawson #];

--

Ken Snell
<MS ACCESS MVP>



Anna Marie said:
I'm not that familiar to Access and would appreciate some help building
the
following SQL query.

I have two tables, and if two categories match within the tables, then I
would like a third category entry updated to the first table.

1st Table: Working
2nd Table: Original

Categories (columns) that should match between table 1 and 2:
Pt Acct #
Charge Cd

If the entires for a line match, then update: Lawson #
(take from Original table and enter into line for Working table)

So, basically if the (Pt Acct #) AND (Charge Cd) in the (Original) table
match the (Pt Acct #) AND (Charge Cd) in the (Working) table , then take
the
(Lawson #) from the (Original) table and update it to the (Lawson#) entry
in
the (Working) table.

Please Help,
 

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

Similar Threads


Top