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

Searching records with the -op begins with


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

Recommended Posts

Is it possible to perform a 'Begins with' search on a field with two words.

It seems this should not be a problem, but I can't get it to only search on the first word.

Here's my code

<select name="-op">

<option selected>equals</option>

<option>contains</option>

<option>begins with</option>

<option>end with</option>

</select>

</td>

<td valign="top">

<input type="text" name="Term" size="15" maxlength="4">

</td>

Case:

I perform a search using "Begins with" and the letter "F"

FMP returns all terms that either start with "F" in the first word or start with "F" in the second word of the term.

I just want it to return the results where it "begins with" "F" in the first word.

Any help would be appreciated. I suspect I might be learning a great deal about how the search works from CDML when this is all over with.

thanks

Link to comment
Share on other sites

"Is it possible to perform a 'Begins with' search on a field with two words."

Yes.

"I perform a search using "Begins with" and the letter "F"

"FMP returns all terms that either start with "F" in the first word or start with "F" in the second word of the term."

Well, that is what happens.

"Any help would be appreciated."

First, have you been successful in performing such a search directly in the db file? Consider this, if you can't do such a search directly in the db file, you probably are not going to work any special magic with CDML.

Second, an option is to limit the field to just one word/initial (perhaps a calc field which parses the first word/initial from the term).

I just love this: "I just want it to return the results where it "begins with" "F" in the first word." I would like to point out that people in Hell want ice-water. Fortunately, designers have more options than people in Hell, but in many instances neither are satisfied. laugh.gif

Perhaps someone else has other, more useful information.

Good luck,

Link to comment
Share on other sites

Hi, shouldn't your operator popup code be:

<SELECT NAME="-OP">

<OPTION VALUE=eq SELECTED>equals

<OPTION VALUE=cn>contains

<OPTION VALUE=bw>begins with

<OPTION VALUE=ew>ends with

</SELECT>

I tried that 'bw' operator from a url string:

http://mydomain.com/FMPro?-db=webrecords&-lay=web&-format=search_results.htm&-op=bw&record_number=z&-find

and it returned correct results.

regards, jeff

Link to comment
Share on other sites

Jeff, while you are correct about the syntax of the popup, and while your link "returned correct results", the question here is did the field you searched ("record_number=z") have a two-word term, e.g. "zebra stripe" and "mongrel zoo"?

I tested this in via the web using a db with over 5000 records and a field in which I would be likely to find the two above examples. And using the "bw" the format file returned both "zebra stripe" and "mongrel zoo".

In orther words (FMPro 5.0v3) does not allow the parameter "bw" to return records in which only the first word begins with the desired letter, but will return all records in which any word in the field "bw" a specific letter.

I do not have the means to test this in Pro 6, though I doubt very much that FMI has enabled this in 6. In fact, I doubt very much that FMI is interested in enhancing CDML any further than it now exists. (Making Lasso look more and more attrractive).

"CDML continues to be a powerful approach to custom web publishing. However, FileMaker is a database company, and we

Link to comment
Share on other sites

I always bet on plenty of calculation fields, when basic FM fails. It works for me in last 11 years.

As Unable suggested, search calc field, which have only one word calculated from current main field.

Rewrite will take 1 minute.

Link to comment
Share on other sites

This topic is 7850 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.