Results 1 to 2 of 2

Thread: Date format

  1. #1
    Join Date
    Aug 2003
    Posts
    328

    Unanswered: Date format

    I am trying to convert a number string into a date. I am using:
    to_date(settdate,'yyyy/mm/dd') "New date"
    in my select statement. I get the error "input value not long enough for date format"
    Why do I get the error?
    Thanks.

  2. #2
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    140
    You are talking about "number string". Is your variable "settdate" a Julian date ? Can you give us an example value ?

    This works for me :

    declare
    a varchar2(100);
    b date;
    begin
    a := '2450450';
    b := to_date(a,'J');
    dbms_output.put_line(to_char(b,'DD(MM/YYYY'));
    end;
    /

    SQL>
    01/01/1997

    SQL>PL/SQL procedure successfully completed.

Posting Permissions

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