Computing.Net > Forums > Office Software > MSAccess case sensitive query

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

MSAccess case sensitive query

Reply to Message Icon

Name: brigitte
Date: March 20, 2003 at 01:08:13 Pacific
OS: Win98
CPU/Ram: 1GHz/256Mb
Comment:

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?



Sponsored Link
Ads by Google

Response Number 1
Name: A Certain TH
Date: March 20, 2003 at 06:13:44 Pacific
Reply:

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 Function

Function Lower(stringIn As String) As String
If stringIn = LCase(stringIn) Then Lower = stringIn
End Function

Close 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


0

Response Number 2
Name: brigitte
Date: March 20, 2003 at 07:53:06 Pacific
Reply:

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


0

Response Number 3
Name: A Certain TH
Date: March 20, 2003 at 08:45:06 Pacific
Reply:

Happy to have been able to help, and just glad it worked!

Tom


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: MSAccess case sensitive query

BRYCO please help www.computing.net/answers/office/bryco-please-help/2533.html

Outlook Express Password Refusal www.computing.net/answers/office/outlook-express-password-refusal/4420.html

Excel 2003 specialized autofilter www.computing.net/answers/office/excel-2003-specialized-autofilter/7145.html