String question

  • Thread starter Thread starter Chris.
  • Start date Start date
C

Chris.

Hi

On my table I have many text, each text is in a field,

I'd like to know if it's possible to compare the text
between each other.

The problem is on the

ID : 100 I have text=This is a test

and on the

ID : 1490 I have text= This is a test.

The problem is the text on the ID=100 and the ID=1490 is
the same the only difference is the point at the end of
ID 1490

Isaw in the help the fonction strComp is this will help

Thanks for any help
 
The first thing you'll need to do is strip off the number. If your data is
always number, space, text to compare, you can get strictly the text using
Mid([ID], InStr([ID], " ") + 1).

Once you have strictly the text, you can use the StrComp function.
StrComp(string1, string2) returns -1 if string1 is less than string2, +1 if
string1 is greater than string2, 0 if they're the same and Null if one (or
both) is null. You can also use an optional 3rd argument to control what
type of comparison is done. Specify 0 (default) to perform a binary
comparison. Specify 1 to perform a textual comparison. For Microsoft Access
only, specify 2 to perform a comparison based on information contained in
your database.
 
Back
Top