Case Sensitive Joints in Access

ankita.sethi

Board Regular
Joined
Apr 27, 2011
Messages
58
Hi,

I have two tables in Access and both have a primarykey with unique values called 'ID'.
But this field has unique values only if you consider case sensitivity. For eg, it might have both 'aa' and 'AA' as values in it. My data is such that I want to consider these as different values (aa <> AA)

So my basic problem is to put a joint on these 2 tables that somehow recognizes case of the text.

Any ideas??
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Kyle123

Well-known Member
Joined
Jan 24, 2012
Messages
2,744
If they are the same characters but a different case then they aren't unique and it's one of the reasons you never use anything meaningful as a primary key - it should either be numeric or a GUID, nothing else.

The only thing that I could think of would be to run a replace on the char codes and join on the result, but I image that it would perform horrendously, most databases are not case sensitive
 

xenou

MrExcel MVP
Joined
Mar 2, 2007
Messages
16,836
Office Version
  1. 2019
Platform
  1. Windows
I think that's right. You could use the ascii values, - quite ugly but at least feasible. I'd probably write a function to convert the value to an alpha-numeric hybrid (or more specifically to populate another field that can be used for the purpose of the join, so as not to destroy the original value). Databases generally are not case sensitive so that's not the way to create a key if you can avoid it.

Example:
065065 for AA (ascii value 65)
097097 for aa (ascii value 97)

Or:
A65A65 for AA
a97a97 for aa

if the table is not large you could probably use your function on the fly to match the tables without having an actual extra column, but I think this would be bad performance on a very large table.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,898
Messages
5,834,295
Members
430,274
Latest member
TME1993

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top