Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Finding multiple exact values for one field

Featured Replies

  • Newbies

Hello,

I cannot figure out how to compose a particular FM query in a URL.

Suppose I have a database of names and addresses. I want to find all the "Smith's" that live in NY or NJ, but not any other states. A SQL-esque query might look like this: SELCT * FROM mydatabase WHERE lastname=smith AND (state=ny OR state=nj)

The FM query I am trying to use looks like this:

http://myserver.com/fmpro? [snipped...] &name=smith&state=NY&state=NJ&-find

If I insert "-lop=and" anywhere in the query, I get NO records found because there are no records that have both NJ and NY as the state. If I include "-lop=or," I get nearly all the records that contain "smith" from any state.

I'm thinking that what I want to do isn't possible in FM with custom web publishing, because the logical operator (-lop) seems like it must apply to the entire query (all values are joined as AND or OR, but not some with AND and others with OR).

Thanks!

FileMaker Version: 6

Platform: Windows 2000

This has been answered. Look in the Sample Files forum for the demonstration CDML -LOP values

There is also a demonstration on the CDML -op values and symbols which you may or may not find useful.

It is written in Pro5.x. You will need to drag and drop.

  • Author
  • Newbies

Unable - thanks for your reply; I have searched and searched and not found the answer in the forums. The sample files for -LOP and -op do not address this issue; this thread poses my question exactly:

http://www.fmforums.com/threads/showflat.php?Cat=0&Board=UBB22&Number=20849&Forum=c9&Words=%2Brefine&Searchpage=0&Limit=500&Main=20842&Search=true&where=bodysub&Name=&daterange=1&newerval=5&newertype=y&olderval=&oldertype=&bodyprev=#Post20849

The issue of selecting a range of values is addressed, but not the issue of performing one find that returns records that have either of two values for a particular field, while excluding records that have all other values for that field.

I'm looking for the web companion equivlent of adding multiple find requests. In my original example, the first request would be name=smith, state=ny, and the second would be name=smith, state=nj.

CDML is a limited in regards to this. However, the work around is to use [FMP-If] tags and Tokens in the Format file. For example:

http://myserver.com/fmpro? [snipped...] &-Token=smith&-lop=or&state=NY&state=NJ&-find

In the Format file use:

[FMP-Record]

[FMP-If:CurrentToken.eq.Field:name]

html goes here

[/FMP-If]

[/FMP-Record]

Good Luck

Garry

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.