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.

creating a range find

Featured Replies

This is not exactly an XML/XSLT question but it is what I am using.

Is there a straight-forward way to create a form to do a range search such as "start date" and "begin date" or "greater than X" and "less than Y"?

Have a look at post http://www.fmforums.com/forum/showpost.php?post/166928/

  • Author

Thanks for the information I found the site: http://www.clicaps.ethz.ch/fmi/xsl/search_advanced_en.xsl to be useful.

It turns out they are using two fields such as "date" and "date_2". I'm guessing "date_2" is a calculation equal to "date". They are doing range searches by doing an "and" find on two separate fields.

Alternatively I discovered that displaying the "date" field twice using a self-join works just as well and eliminates the need for creating extra fields and calculations.

I haven't done any web design or used XML/XSL, etc., yet I'm wondering if you created a relationship that returns a range of records using Start_date and End_date if you could use that?

I haven't done any web design or used XML/XSL, etc., yet I'm wondering if you created a relationship that returns a range of records using Start_date and End_date if you could use that?

No you can't. What he needs is a user-defined, dynamic range.

Thanks for the information I found the site: http://www.clicaps.ethz.ch/fmi/xsl/search_advanced_en.xsl to be useful.

It turns out they are using two fields such as "date" and "date_2". I'm guessing "date_2" is a calculation equal to "date". They are doing range searches by doing an "and" find on two separate fields.

No, "they" :laugh: don't use two fields date and date_2. Or I misunderstood you and you mean something else.

This is a general form where fields, operators, and values (up to three) can be mixed in any order (some JavaScript is used to dynamically change the input options, e.g. if ISBN is needed, the form is reduced to one field only, because ISBN is unique and no other criteria are needed). All the data (field names, operators and field values) are submitted to a database without any search, but stored. Then in a subsequent stylesheet, these intermediate values are taken and the final query is constructed.

As said, if you seek a solution for a simple form, read the hint a gave in the cited post (either with field.op=bw and startdate...enddate or with field.op=bw and > and < added to the data).

  • Author

I tried using the following example with no success:

When I try to reference the same field name twice in a form I get an error.

Remove one line , e.g.












then it should work, as I have just found from a test file (with different range tests).

I will submit the test file later (it's about a dozen different tests, and it's not yet finished).

Here is a zip file with a quick and dirty DB and 4 XSLT files for doing tests on text, number, and date ranges.

The tests are made with GET queries (URLs), but one can easily derive a POST query (a form) from them.

test_ranges.zip

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.