Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7392 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I need two different search functions in the same table. One of them must find all the words that contain the letters which are typed. One of them must however find the complete word that is typed. I have the first one. Can anybody helps me with the second one?

Thanks,

Posted

Use the position function to find the word in the large field. e.g.

Syntax:

Position(HAYSTACK, NEEDLE,1,1) returns 2 when string value in variable NEEDLE is found starting in character position 2 of string HAYSTACK. The 1,1 part tells FM to start in position 1 and find the (1) first occurance of NEEDLE in HAYSTACK. I think there is also a simplier form that assumes one of these.

Examples

Position("Mississippi", "iss",1,1) returns 2 .

Position("Mississippi", "iss",1,2) returns 5 .

Position("Mississippi", "iss",3,1) returns 5 .

Left(Name, Position(Name, " ", 1, 1)-1) returns William, when Name is a text field that contains William Smith.

Right(Name, Length(Name) - Position(Name, " ", Length(Name), -1)) returns Smith .

This finds the string, and returns a position within the 'haystack' where the 'needle' is found.

--Tripod

Posted

Note that == will give you ONLY the exact text entered and nothing else. So if you are looking for Suzuki 4x4 and you enter ==Suzuki, you will not find the 4x4 record, only records where the field equals 'Suzuki' and nothing else.

This topic is 7392 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.