DATETIME in Forms 6

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • uthra

    DATETIME in Forms 6

    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
  • stefano biotto

    #2
    Re: DATETIME in Forms 6

    shankaruthra@ya hoo.com (uthra) wrote in message news:<c6fa8591. 0310080821.4027 dfdc@posting.go ogle.com>...[color=blue]
    > 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[/color]

    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_ch ar(now,'HH:MI:S S AM');
    MY_BLOCK.date:= to_date(to_char (MY_BLOCK.date, 'mm/dd/rrrr')||' '||
    txt_time,'MM/DD/RRRR HH:MI:SS AM');
    end;

    Comment

    • sybrandb@yahoo.com

      #3
      Re: DATETIME in Forms 6

      shankaruthra@ya hoo.com (uthra) wrote in message news:<c6fa8591. 0310080821.4027 dfdc@posting.go ogle.com>...[color=blue]
      > 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[/color]

      Apparently your users don't WANT to enter the time. THAT can't be
      resolved by changing format masks.

      Sybrand Bakker
      Senior Oracle DBA

      Comment

      • Mark D Powell

        #4
        Re: DATETIME in Forms 6

        shankaruthra@ya hoo.com (uthra) wrote in message news:<c6fa8591. 0310080821.4027 dfdc@posting.go ogle.com>...[color=blue]
        > 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[/color]

        Just code an edit into the form logic and validate that the user
        provides the time. Depending on your circumstances you may also be
        able to default the field value to sysdate and just have the user
        overtype it when the value is different.

        HTH -- Mark D Powell --

        Comment

        Working...