If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Date format

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-18-03, 11:50
exdter exdter is offline
Registered User
 
Join Date: Aug 2003
Posts: 328
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.
Reply With Quote
  #2 (permalink)  
Old 11-19-03, 07:36
cvandemaele cvandemaele is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On