Comparing text fields to find upper case lower case mismatches

R

RAN

I have to compare a text field in one table to a corresponding text field in
a master table. I need to identify where the case of each letter doesn't
match the case of each letter in the master table. I've tried using the
StrComp function in a query but I'm not getting the expected results. Can
anyone help? For example,
StrComp(Stainless Steel, stainless steel) gives a value of 1, but
StrComp(Stainless Steel, Stainless Steel) also gives a value of 1.
Thanks in advance for your help.
 
B

Beetle

Untested, but try using a criteria like;

Where StrComp([Field1], [Field2], 0)<>0
 
R

RAN

The query is still getting all records where there is a match. Should this
not be done in a query? "Where" & "StrComp()" in the field definition or in
the criteria gives a invalid syntax error, so I dropped the "Where" in the
Field Definition and put the <>0 in the Criteria.
StrComp(Stainless Steel, Stainless Steel, 0) = 1

Beetle said:
Untested, but try using a criteria like;

Where StrComp([Field1], [Field2], 0)<>0

--
_________

Sean Bailey


RAN said:
I have to compare a text field in one table to a corresponding text field in
a master table. I need to identify where the case of each letter doesn't
match the case of each letter in the master table. I've tried using the
StrComp function in a query but I'm not getting the expected results. Can
anyone help? For example,
StrComp(Stainless Steel, stainless steel) gives a value of 1, but
StrComp(Stainless Steel, Stainless Steel) also gives a value of 1.
Thanks in advance for your help.
 
R

RAN

Thanks for your help. One of the fields has blank spaces after the text, so I
used the Trim() function to remove all blanks around the text and StrComp()
works like a charm. Thanks again.

Beetle said:
Untested, but try using a criteria like;

Where StrComp([Field1], [Field2], 0)<>0

--
_________

Sean Bailey


RAN said:
I have to compare a text field in one table to a corresponding text field in
a master table. I need to identify where the case of each letter doesn't
match the case of each letter in the master table. I've tried using the
StrComp function in a query but I'm not getting the expected results. Can
anyone help? For example,
StrComp(Stainless Steel, stainless steel) gives a value of 1, but
StrComp(Stainless Steel, Stainless Steel) also gives a value of 1.
Thanks in advance for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top