ACC: How to Return Case-Sensitive Matches in QueriesID: Q95605
|
Advanced: Requires expert coding, interoperability, and multiuser skills.
You can use the Asc() function to have Microsoft Access differentiate
between case sensitive text strings. When you use this function in a
select query, Microsoft Access can locate an exact, case sensitive match.
This technique is useful in a situation where you need to find all the
records in a field that contain lowercase text rather than uppercase text
for the first character. An example of this might be in the Employees table
of the Northwind.mdb sample database (or NWIND.MDB in versions 1.x and
2.0).
NOTE: You can perform full case-sensitive comparisons in a query by using
the built-in StrComp() function. All you need to do is create a column with
the following expression
StrComp([FieldName],"SearchForThis",0).
FirstName
---------
andrew
Andrew
Nancy
NOTE: In versions 1.x and 2.0, there is a space in the First Name field
name.
Query: QueryTest
--------------------------------
Field name: FirstName
Show: True
Field name: Asc([Firstname])
Show: True
First Criteria Line: Asc("a")
For more information about the Asc() function, search the Help Index for
"Asc function."
For more information about Case-Sensitive comparisons, search the Help
Index for "case sensitivity."
Additional query words: chr chr$ how to
Keywords : kbusage QryParm
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: March 19, 1999