Link to home
Start Free TrialLog in
Avatar of pcladylr
pcladylrFlag for United States of America

asked on

Access string comparison

I need to compare data in two tables. Table 1 has the full, 9-digit social security number, but Table 2 only has the last four digits. I know I could extract the last four digits of the first table in Excel using Text to Columns, but it seems like there would be a way to do this when I create the subset of data for Table 1. I'm not real fluent in SQL, but understand the principles. This will be used on a monthly basis verify vendor statements, so I'd like to automate as much as possible now.

Appreciate an answer to this one.

Cathy
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

you can do this in access using a query like this

select table1.*,  table2.*
from table1, table2
where right([Table1].[ssn],4)=table2.[ssn]
ASKER CERTIFIED SOLUTION
Avatar of Flyster
Flyster
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pcladylr

ASKER

I chose your answer because it shows me how to create this four-digit field in the initial query where I am creating Table 1.

Thank you!
pcladylr,

the query i posted gives you what you are looking for..
And, thanks to both of you for responding so quickly.
Capricorn1: Sorry, I just now saw your comment and realize that you indeed did provide the correct answer. I'm not very SQL literate and didn't recognize it. You certainly deserve points. Is there a way I can remedy this? Thank you.
I have no problems with splitting points. I forgot to refresh and didn't see Capricorn1's response!
Thanks, Flyster. How do I go about doing that?
That's new territory for me. I would try the request attention link under your original post. That will get to one of the moderators.