Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2003
    Posts
    26

    Unanswered: receive date of format dd.mm.yyyy HH24:MI

    I'm going through a displayed table with a loop.
    I'm using YSTEM.CURRENT_VALUE to receive the value of the actual item
    which is appended to the variable mystring of type VARCHAR2(1000)

    If there is a date field in the table (e.g.: emp.hiredate),
    (the item is in forms of type DATE with the Format Mask: dd.mm.yyyy HH24:MI ),
    I receive only the date part. The hours, minutes are always set to 00

    How can I hand over the correct hours, minutes to mystring ?

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    If value stored into the column is truncated to date, there's no way to return time part of it:
    Code:
    SQL> create table brisime (datum date);
    
    Table created.
    
    SQL> insert into brisime values (sysdate);
    
    1 row created.
    
    SQL> insert into brisime values (trunc(sysdate));
    
    1 row created.
    
    SQL> select datum, to_char(datum, 'dd.mm.yyyy. hh24:mi:ss') date_time
      2  from brisime;
    
    DATUM    DATE_TIME
    -------- --------------------
    05.10.05 05.10.2005. 12:48:35
    05.10.05 05.10.2005. 00:00:00
    
    SQL>

  3. #3
    Join Date
    Aug 2003
    Posts
    26
    Thanks for your attention.

    I think the problem was, that the forms-item containing the date was of type DATE but should have been of type DATETIME

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I don't think so, Hudo ... fields of Date datatype can display date AND time (although, as Forms online help system says, "The DATE data type is not intended to store a time component.").

    I checked one of my forms and the field of DATE datatype displays time component.

    Are you sure this is the problem solution? Perhaps it depends on Forms version? The one I checked was written in 10g ...

  5. #5
    Join Date
    Aug 2003
    Posts
    26
    Hello Littlefoot,

    the change from type DATE to type DATETIME solved my problem.

    Although the type DATE in conjunction with the initial format mask dd.mm.yyyy HH24:MIS displays in forms the date part and the hour part correctly,
    if I tried to export this value, respectively append it to mystring, the hour part is constantly set to 00:00:00

    After changing the type to DATETIME, the export worked as I liked it.

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I see ... so, for displaying purposes DATE is OK (which is the case in my form), while for others DATETIME should be used. Something new again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •