Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hi there,

I want to let my user find a specific record based on a date, in a range of two dates. The field the record is based on is called 'startdatum' (Sorry, I'm Dutch...). I've copied this field into two other fields, called webstartdatum1 and webstartdatum2. I figured out that, when searching, I let users enter two dates on the HTML page. One is put in webstartdatum1 with the operator >=, the other one in webstartdatum2 with the operator <=. During search, I use the AND operator while submitting. That way I thought I let them search for anything between those two dates (sounds logical, doesn't it ?)

On the web, I use this code :

<SELECT NAME="[op]">

<OPTION VALUE="gte">&gt

</SELECT><INPUT TYPE="text" NAME="startdatumweb1" VALUE="" SIZE="22">

and :

<SELECT NAME="[op]">

<OPTION VALUE="lte">&lt

</SELECT><INPUT TYPE="text" NAME="startdatumweb2" VALUE="" SIZE="22">

Ok, so far so good.... Tried it, won't work... When entering only one of the dates, I find all records based on that date. So, I figured out, the operator-part is wrong. But I can't find out what I'm doing wrong..... Anybody got an idea ??

Thanks,

Andr

Posted

Of course what you have tried does not work. This has been regularly discussed in these forums. It does not work because the -op tag is quite useless. Although FMI claims that one can use the cdml tags with html to custom publish, they are misstating the reality. In fact, if you look at their examples, the ONLY way you can get the -op tag to work is by using the lanugage JavaScript - which is not html.

You need to consider the information available about performing an exact search. When you understand that technique, you will be able to adapt the information to using a range - or any of the other symbols found in the status bar when you are performing a find in the db.

[ September 05, 2001: Message edited by: Keith M. Davie ]

Posted

The problem is also with two fields. You must construct your request to be inserted into 1 single date field. That is not difficult, just use the values inserted into single field.

Will that be better approach in your scenario?

  • 2 weeks later...
Posted

use javascripting to validate empty based on empty's.

function valiDate(field, field2){

if(!field && !field2)

{

return true

}

else{

if(!field || !field2)

{

return false

}

}

}

(you get the general idea.)

Posted

Right-o Keith. The javascripting would be in response to the fact that arotgans has two date fields. If they were combined into one field then a -script or a "..." range could be made.

If I understand the problem correctly, this is for some sort of project or hotel database, in which case one field is impossible without having a calc field that checks to see if the value is within the two field (then you get into the issue of a related DB just to have a new record created as they do the find which stores the value to perform the nessasary validation.)

The -op tag is not 100% useless, but it takes some playing around to work properly. The main thing that doesn't work correctly with the -op is the date field.

Posted

And I suppose then that because the -op does not work with a date range find that my earlier recommendation about understanding the exact search can lead to understanding how to use the date range may well be the best advice so far.

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