Inner Join Uppercased Text Fields

I'm running a query to clean up unsubscribed email addresses. I have a "remove" list and I have the customer list. I'm using an inner join to link the two lists (tables) and then remove the email address from the customer so they don't receive more emails.

How can I handle it if the capitolisation is different from the Remove list to the Customer list?
Is there a way of forcing both lists to upper or lowercase so that I get a match no matter how the email address was entered?

PS: Running Access front end with a few local tables but most via an ODBC link to the SQL server.
LVL 10
slamhoundAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CutSackCommented:
Hi slamhound,

Can you convert the joined fields to lower case in your query? i.e.:

Select *
from table1 inner join table2
on lcase(table1.email) = lcase(table2.email)

Select *
from table1 inner join table2
on lcase(table1.email) = lcase(table2.email)
 
(above for odbc) or if using a T-SQL Query use below:
 
Select *
from table1 inner join table2
on lower(table1.email) = lower(table2.email)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
slamhoundAuthor Commented:
I'm using an Access query so I tried your LCase example but it's taking ages to run. The customer file (on SQL) is quite large but the unsubscribe list (Access) is quite small.

Is there any way to speed this process up?
0
CutSackCommented:
The qurey below might be quicker (although I' not sure if the syntax is valid in access) - the conversion to lower case is already done before the join.

If not , you might need an index on the email field in the SQL table if it is taking a long time.


Select * 
from (select lcase(email) as lemail from sqlcust) as scust
inner join (select lcase(email) as lemail from accesscust) as acust
on scust.lemail = acust.lemail

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.