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

From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: Sun, 4 Jul 1999 20:52:06 +0100
Message-ID: <DT$IOCAmt7f3EwMm_at_ahardy.demon.co.uk>


In article <377D0E8B.88CF6614_at_xmission.com>, Sean McMurray <smcmurr_at_xmission.com> writes
>Andy Hardy wrote:
>
>> 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?
>
>Two thoughts. I don't know if either will work but, here you go.
>
>1. What if the user enters 10-JAN-1998%

Excellent... I've just been looking at the :system.last_query in the pre-select and introducing a '%' makes the select to a to_char like comparison. I'm much surprised by this!

I may have to fiddle with some of the post-text, etc. to make sure that the '%' is present but it does look hopeful.

Andy

-- 
Andy Hardy. PGP key available on request
===============================================================
Received on Sun Jul 04 1999 - 21:52:06 CEST

Original text of this message