Re: DATETIME in Forms 6

From: stefano biotto <sbiotto_at_tiscali.it>
Date: 9 Oct 2003 00:12:10 -0700
Message-ID: <f0c9a526.0310082312.2043e85b_at_posting.google.com>


shankaruthra_at_yahoo.com (uthra) wrote in message news:<c6fa8591.0310080821.4027dfdc_at_posting.google.com>...
> Hi,
> We are having forms 6 and i having a form which has the column as
> datetime. I need to have it as datetime for the user to put the time
> etc. And i have the format mask as MM/DD/RRRR HH:MI:SS AM. If the
> user puts the mm/dd/rrrr and leaves the field without putting the hour
> & minutes the default time 12:00AM gets registered. We don't want
> this to happen as it gives the incorrect report. Please let me know
> what is the format mask i should use in order to correct this problem.
> I also tried HH24:MI:SS. But this way the user can't choose AM/PM
> instead they have to put 21 for 9PM. Please advise.
>
> Thanks in advance

You could fill the the mm/dd/rrrr that the user puts in the item MY_BLOCK.date
using the trigger:
WHEN-VALIDATE-ITEM of MY_BLOCK.date
declare

   now date;
   txt_time varchar2(20);
begin

    select sysdate into now;
    txt_time:=to_char(now,'HH:MI:SS AM');     MY_BLOCK.date:=to_date(to_char(MY_BLOCK.date,'mm/dd/rrrr')||' '||

                   txt_time,'MM/DD/RRRR HH:MI:SS AM');
end; Received on Thu Oct 09 2003 - 09:12:10 CEST

Original text of this message