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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find uppercase names in query.

Status
Not open for further replies.

dawnd3

Instructor
Jul 1, 2001
1,153
US
In Access 2003 is there a way to determine the case of a field? Basically, I have a bunch of records and some names are in all upper case and some are in regular case. I would like to be able to pull out the ones that are in regular case.

Thanks for your help.

Dawn

 
Access considers that "a" = "A" so I think you're going to have to write yourself a function which will loop through the string and check whether the ASCII code of every character is between 65 and 90.

Geoff Franklin
 
use StrComp for your comparison.

In VBA you can set the Option Compare directive to Text, Database or Binary. But changing this will have impact on things you may not realise. So it's better to localise the change.

In your query,
Code:
SELECT * FROM table1 
WHERE StrComp(lcase([field1]),[field1],0) <> 0
Note that 0 is the parameter in StrComp that specifies Binary Compare.

This will discover any fields which have at least one uppercase character in them.

 
Thank you both for your help. I found another way to get the job done. Having nothing to do with uppercase or lowercase I just pulled out all the records that had a comma since those were the individual names that happen to be lowercase. The company names were all in CAPS. I just got lucky.

:)

Dawn

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top