Managing DATE in FORMS
Date: 1997/02/26
Message-ID: <33147016.B8B_at_kjws.com>#1/1
[Quoted] [Quoted] I'm in trouble for the following problem:
[Quoted] [Quoted] In a Form (dev/2000 1.3 x win95) I have a DATE field corrisponding to
[Quoted] a database DATE field ... when I try to make a query on this field (e.g.
01/02/97), no record is returned (NLS_DATE_FORMAT is set correctly, both
on server and client).
(Similarly in PL/SQL I get nothing if I do: SELECT * from EMP where
[Quoted] ins_date='01/02/97';)
I was told from hot line service the problem is the following: a database date value contains (of course) not only the date but also the hour ... so when I try to inquery just by date, I get nothing.
First question: is it true?
[Quoted] Second problem: how to resolve it?
[Quoted] I've got the following two solutions ... but I don't like neither:
1- Do not use DATE field in the database, but only varchar2 (when I'm just interested in the day and not in the hour)
[Quoted] 2- in the form, manage the date field in the following manner:
- create a DATE field (say nodb_block.ins_date) NOT in-database
- hide the in-database date field (say emp.ins_date)
- in the Pre-Query trigger, put the statements:
IF :nodb_block.ins_date IS NOT NULL THEN
Set_Block_Property('block0',DEFAULT_WHERE,'To_Char(ins_date)='''||To_Char(:nodb_block.ins_date)||'''');
ELSE
Set_Block_Property('block0',DEFAULT_WHERE,NULL);
END IF;
please, answer me directly too
thank you very much in advance Received on Wed Feb 26 1997 - 00:00:00 CET