Re: F45, how to query a date(time) column with just the date?

From: Dennis <dennis_at_bearclaws.com>
Date: Fri, 2 Jul 1999 18:52:12 -0500
Message-ID: <377d50a4.0_at_news.primary.net>


Here's one approach...

Use a Pre-Query trigger, grab whatever the user put in (must use NAME_IN built-in to get the whole string the user put like any funky characters like #,>,<,>=, etc).

If the user put in an exact date (sans special chars) then construct a default where clause, insert in the block (SET_BLOCK_PROPERTY....), clear whatever the user put in, then let the trigger complete. Your where clause will be like ....
TRUNC(db_datetime_stamp) = (search_date) (might try "between" syntax if column indexed)

If the user meant to use funky search chars then just let it happen without doing above. You may need to clear out default where later.

Hope this helps,
DJ

Andy Hardy wrote in message ...
>Hi,
>
>I have a table which includes a date column.
>
>I would like the user to be able to query this table using this date,
>but I don't want them to have to enter the time part of the date.
>Instead, I want all records for that 'date' to be retrieved.
>
>The form is to be based on the table.
>
>E.G.
>
>PK action_date action_type
>key1, 10-JAN-1998 02:14, 1
>key2, 10-JAN-1998 12:10, 1
>key3, 10-JAN-1998 22:14, 1
>key4, 11-JAN-1998 02:14, 1
>
>When in query mode, the user enters 10-JAN-1998 in action_date and
>enters 1 in action_type. The first three records should be retrieved.
>
>Any thoughts?
>
>--
>Andy Hardy. PGP key available on request
>===============================================================
Received on Sat Jul 03 1999 - 01:52:12 CEST

Original text of this message