Update Query

cvaccess

Registered User.
Local time
Today, 14:15
Joined
Jun 27, 2002
Messages
48
I am trying to update Table A PCP field with Table B PCP field when the zip field in both Table A and B match. Is an update query the best way to do this? If so, please give me an idea on how to do this.

Thanks.
 
Yes.
Add both tables to the QBE grid.
Join them on ZIP.
Change the query type to update.
In the first available field cell, select the PCP field of the A table.
In the criteria cell put -
[table B name].PCP

Zip does not seem to be the correct thing to join on since unless this is a table of zip codes, zip will not be unique and you could have multiple values in the PCP field of table B so I don't know what would happen but I'll bet it won't be pretty.
 
update query

Well, the match needs to be based off of zip. For example, if zip 04101 in Table A is found in Table B then update the pcp field from Table B to Table A.

Hope this makes sense. How could I do this?

Thanks.
 
I told you how to do it. Analyze your data to see if there is a potential problem.
 
Update query

I did analyze my data. There was a match of zip field 04101 on both tables. Now I want to update the pcp field in Table A with the pcp field it matched in Table B.

Thanks.
 
Is there a question here? Did you build the update query?
 
Pat has already answered your ??

Add both tables to the QBE grid.
Join them on ZIP.
Change the query type to update.
In the first available field cell, select the PCP field of the A table.
In the criteria cell put -
[table B name].PCP

This will only yield records where the two fields are equal.
 

Users who are viewing this thread

Back
Top Bottom