Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

search in field with criteria of upper/lower cases

Status
Not open for further replies.

Emmitska

Programmer
Feb 9, 2005
18
US
Hello,

I would like to know if there is a way to write a query that would select the records where a certain field CONTAINS upper cases?
Thank you very much.
 
One way:
WHERE LCase([field name]) <> [field name]
Another way:
WHERE [field name] Like '*[A-Z]*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 

Any uppercase letters or ALL uppercase??

John
or
JOHN
or
jOhn

???
 
Guys, it doesn't work.
In fact, I wanted to see all the records where you have all caps. So here is what I did to make sure:

I selected the field, selected the UCase of the same field, and then I select the records where only the field and the expression are equal:

SELECT A, B, UCase(B)
FROM Table
WHERE UCase(B)= B
ORDER BY A, B;

Well, in SQL I guess it is same as:

SELECT A, B
FROM Table
WHERE UCase(B)= B
ORDER BY A, B;

But, it does not work. The thing with the first query is that I see the two fields, the original and the all caps and they are different, right? Some are equal, how come I do not see ONLY those in the result!?

Thanx for help.
 


Please provide EXACT example of the data you wish to include in your query.

Johnny - No
jOHN - Yes
JOHN - Yes

etc. etc. etc. As I said in my previous question???



 
You need to use StrComp() or something else as Access is case-insensitive.

i.e "Jones" = "jONEs" = "JONES", etc

traingamer
 
Thanx traingamer, it worked perfect!
And HitechUser, when I used the example "johnny", I used a longer word to make sure you would understand what I meant... sorry it upset you.



 
Emmitska,

It was not that is upset me. I was simplu wanting a better explanation of your request. The length of the text was not relevent to my question. I was trying to determine which type of mixed case events were you trying to return in your SQL.

Well that's the way it goes..

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top