Jump to content

Finding date in range, via the web


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

Recommended Posts

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

Link to comment
Share on other sites

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 ]

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

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