matching table

G

Guest

I have 2 tables; one table with employee data (name, addr, ss#, empID, etc..)
and another table with insurance plans via zip codes. I need to match the
employee Zip code from the 1st table with the PPO list in the 2nd table so I
can tell what PPO he is eligible to join. What is the best way to do this?
I tried a query with an inner join, but I'm uncertain if I have ALL of the
participants in the area that are eligible for that PPO or if it is matching
just the first zip code it comes to on the list. Any help would be greatly
appreciated.
 
G

Guest

Post the SQL for the query that you have now.

It should be fine unless you are doing something like a Distict or Totals
query. About the only way to drop records from either table is to not have a
matching zip code on either side.
 
G

Guest

SELECT tblUpload.ZIP, tblUpload.EESSN, PPOZipCodes.ZIP INTO tblZipMatch
FROM tblUpload LEFT JOIN PPOZipCodes ON tblUpload.ZIP = PPOZipCodes.ZIP;
 
G

Guest

when I run the query the column in the resulting table for PPOZipCodes only
has 5 results... I have an inner join that says "include ALL records from
tblUpload & only those from PPOZipCodes where joined fields are equal."
 
G

Guest

Your SQL should be doing exactly what you want. Remember that the zip codes
must match exactly and be in both tables. Something like a Zip + 4 will not
match up with a 5-character Zip. Also any leading or trailing spaces could
mess things up. Look at the five records returned and see if more of them are
in both tables.
 
G

Guest

Your SQL should be doing exactly what you want. Remember that the zip codes
must match exactly and be in both tables. Something like a Zip + 4 will not
match up with a 5-character Zip. Also any leading or trailing spaces could
mess things up. Look at the five records returned and see if more of them are
in both tables.
 
G

Guest

OK I figured it out! My problem was in the definition because it caused a
dash in one that was not in the other. I formatted both as a 5 char text
field and it worked! Thanks a bunch!
 

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