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

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
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
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

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
Back
Top