Re: Querying a Date Range in FORMS

From: Andy Yun <ayun_at_infosyscorp.com>
Date: Fri, 28 Aug 1998 18:19:05 -0700
Message-ID: <35E75709.B796AF02_at_infosyscorp.com>


Ed,

You can accomplish what you need to do via PRE-QUERY trigger. First you would have to change the field's data type to Char so that you can enter data such as 15-AUG-98..18-AUG-98. In PRE-QUERY you would have to parse the data to find out what conditions apply (>= or between) and dynamically change your default where conditions in your block property. It's a little bit involved but you can certainly do the trick. Your solution may differ slightly if you are using base table fields or control fields. For example,
if you are using base table you must programmatically clear the field so

that you query will work.

If possible I would try to convince your users to work with two fields which would allow them to do more things such as >=, <=, and between. To make it easy to use you might consider defaulting the 2nd field value to the value of the first field. Of course there are users who would never want to change even if the change is better.

Andy Yun
InfoSys Corporation
ayun_at_infosyscorp.com
http://www.infosyscorp.com

Ed Jennings wrote:

> I have a date field in a FORM. Sometimes the user wants
> to query a range of dates, as opposed to a particular date.
> How can this be done. The users have no knowledge of SQL, and
> couldn't construct an 'AND' clause if their life depended on it.
> What they would like to enter is something like:
>
> 15-AUG-98..18-AUG-98
>
> The FORM needs to be smart enough to recognize a single date or
> a range of dates. Anyone know how this can be done without
> introducing a second date field?
>
> TIA
>
> Ed Jennings
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> jenningse_at_mindspring.com
>
> "The opinions expressed here are my own, not those of DOMAIN
> technologies"
Received on Sat Aug 29 1998 - 03:19:05 CEST

Original text of this message