Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I've inherited a huge SQL database & access much of the data using MSAccess97.
One thing I desprately want to do but don't know if I can is access records depending whether data in some of the fields is upper or lower case.Are case sensitive queries possible?

Hi Brigitte
(this solution is in Access 97 - I can't vouch for there being no built in function in Access 2000 onwards)
The only way I can think of doing this is by defining some simple code:
In the Modules tab click "New"
Use the right-hand drop-down box to select "(declarations)"
Change "Option Compare Database" to "Option Compare Binary" (or just add "Option Compare Binary" if there is nothing there)
Then paste in these couple of functions:
Function Upper(stringIn As String) As String
If stringIn = UCase(stringIn) Then Upper = stringIn
End FunctionFunction Lower(stringIn As String) As String
If stringIn = LCase(stringIn) Then Lower = stringIn
End FunctionClose and Save the Module
Now you can use the new functions in a query criteria as follows:
Lower([TableName]![FieldYouAreChecking])
or
Upper([TableName]![FieldYouAreChecking])Only those meeting the criteria will be returned.
Hope that helps (and works!)
Tom

You little treasure.....
Thanks ever so much for taking the time to respond to my cries for help, you have saved me lots of time & trauma.
Many regards from Wales,
Brigitte

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |