|
 |
access thread: Search for Upper Case letter
Message #1 by Andy Olsen <andyolsen2000@y...> on Sun, 18 Feb 2001 09:22:06 -0800 (PST)
|
|
How can I query for the occurrence of an upper-case
letter anywhere in a field value? For example, I have
a field of UserNames which consists of individual as
well as group accounts. The group usernames are
capitalized, whereas the individual usernames are all
lower case. I want the query to return the group
usernames only. Thanks in advance.
=====
Andy Olsen
AndyOlsen2000@y...
xxx.xxx.xxxx
Message #2 by "Pardee, Roy E" <roy.e.pardee@l...> on Mon, 19 Feb 2001 07:55:29 -0800
|
|
It's a tad kludgy, but this should work:
Use LCase() to convert your string to all lower case, and compare the result
to your original field with the StrComp() function, using the binary compare
option (as opposed to the text compare option, which is case-insensitive).
StrComp will return a 0 if the two versions of your field are the same. You
want the records where the lowercased version of your field is *not* the
same as the raw version.
So if your field is called UserName & your table is called Accounts, you'd
say:
SELECT UserName
FROM Accounts
WHERE StrComp([UserName], LCase([UserName]), 0) <> 0 ;
HTH,
-Roy
-----Original Message-----
From: Andy Olsen [mailto:andyolsen2000@y...]
Sent: Sunday, February 18, 2001 9:22 AM
To: Access
Subject: [access] Search for Upper Case letter
How can I query for the occurrence of an upper-case
letter anywhere in a field value? For example, I have
a field of UserNames which consists of individual as
well as group accounts. The group usernames are
capitalized, whereas the individual usernames are all
lower case. I want the query to return the group
usernames only. Thanks in advance.
=====
Andy Olsen
AndyOlsen2000@y...
xxx.xxx.xxxx
|
|
 |