Queries with Capital Letters

H

Harv

Hi, I hope you can help me out.

Here is my situation. I have a field with a single letter in it. I would
like to be able to query the data based on this field. My problem is this.
There can be upper or lower case letters as well as numbers in this field. A
capital 'A' means something different than the lower case 'a'. For instance,
can a query be used to pull just the data with a capital 'A'?

Thanks
Harv
 
A

Allen Browne

Access can't do this natively, so don't design a database this way.

If you're stuck, you can use the StrComp() function in the WHERE clause of
the query, to compare two text values.
 
P

PC Datasheet

In an empty field in your query, put this expression:
MyLetter:Asc([NameOfLettersField])
put this in the criteria:
65
The query will now give you all the records with a capital A. If you want
some other character, look at Ascii in the Help file for the Acs value of
the character you want.

Just to note, if you want A or B, set the criteria to:
65 or 66
 
Top