Re: Find uppercase letter in a string




"Arts" wrote:
I have field KRITERIUM containing strings for example Biii(aii) or Biii(D1)
an so on. I want to select all rows that contains uppercase letters
anywhere
in the string. I want to get 2 rows where there is 2 uppercase letters. Is
it
possible?
I have tried StrComp and Mid but I don't understand how I can get any
uppercase letter in the string(the first or the fifth or...)
--

I would think StrComp would get the job done...

if the job is to identify rows that contain uppercase
letters anywhere in the string....

Maybe I have missed something, but what are your
results if you add the following to a Field row in an
empty column of your query design grid?

TestUpper: StrComp([KRITERIUM], LCase([KRITERIUM]),0)

it should be doing a binary compare of the field
with the lower case form of itself...

if they are equal, it should return 0
(meaning no uppercase letters)

if different, it should return either 1 or -1
(meaning there must be an uppercase letter)

if field is NULL, will return Null
(will assume you don't care about Null)

so, in Criteria row

<> 0

or, you can complete expression in Field row

HasUpper: StrComp([KRITERIUM], LCase([KRITERIUM]),0) <>0

then set Criteria to -1 or True


.