August 25, 200421 yr 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,
August 25, 200421 yr 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
August 26, 200421 yr Author You can find the whole word if you put == before the word that you are searching. For more information for the people with the same problem is this site a good source. http://www.quepublishing.om/articles/article.asp?p=174333&seqNum=2 Thanks Tripod any way.
August 26, 200421 yr 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.
August 27, 200421 yr Just to chime in, using a search of =Suzuki will find only exact words, so "Suzuki 4x4" will be found, but not "Suzukini".
Create an account or sign in to comment