Re: FORMS4.5:query between dates?

From: Dan Townsend <townsend_at_ebmud.com>
Date: 1997/07/31
Message-ID: <33E0A369.16AB_at_ebmud.com>#1/1


A couple of ways:
(1) Type this in the query field: # between '01-JUN-97' and '01-JUL-97' (2) Type &d in the query field. When you execute, you will get the 'Query Where' edit box. Type this:

    &d between '01-JUN-97' and '01-JUL-97'

In the first case, the WHERE clause of the SELECT statement gets created with the column name followed by the text you typed in the field. To see what I mean, type #x in a field and execute the query. You will get an error and can use Display Error to see the SELECT statement that was generated. This is a handy ad hoc debugging aid when developing forms and you want to know the specific SELECT statement forms is using.

In the second case, &d is a place-holder for the column name in the WHERE clause of the SELECT statement that is sent to the server. You can do very complex stuff with this, including &d IN (subquery) queries.

edwards_at_garland.dnr.state.sc.us wrote:
>
> I've got a simple form with one of the base table items being a DATE.
> I can query all dates greater or less than a given date,
>
> >30-JUL-97
> <30-JUL-97
>
> but how to I query between two dates?

 +-----------------------------------------------------
| Dan Townsend, Supervising Database Architect
| EBMUD Enterprise Object Designer
| mailto:townsend_at_ebmud.com
+-----------------------------------------------------
Received on Thu Jul 31 1997 - 00:00:00 CEST

Original text of this message