Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Char to Date Convertion

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Ganesh K Rajan

New User


Joined: 13 May 2005
Posts: 7

PostPosted: Thu May 26, 2005 3:25 pm    Post subject: Char to Date Convertion
Reply with quote

Hi,
I wanted to convert date declared as char(7)(in CYYMMDD) to date format (YYYYMMDD).
I used the following query :

SELECT DISTINCT POLICY_NO,TRANS_DTE, TO_DATE((SUBSTR(TRANS_DTE,2,6)),''YYYYMMDD'') FROM DB2PADM using TO_DATE function but it gives following error.

SQLCODE = -171,
ERROR: THE DATA TYPE, LENGTH, OR VALUE OF ARGUMENT 2 OF TO_DATE IS INVALID
Can anyone suggest any other way.

Rgs,
Ganesh.
Back to top
View user's profile Send private message

prasannanjaneya
Warnings : 1

New User


Joined: 14 Mar 2005
Posts: 10
Location: pune

PostPosted: Thu May 26, 2005 5:07 pm    Post subject:
Reply with quote

hi,

i have a doubt. in char(7) c stands for what.
Back to top
View user's profile Send private message
prasannanjaneya
Warnings : 1

New User


Joined: 14 Mar 2005
Posts: 10
Location: pune

PostPosted: Thu May 26, 2005 5:57 pm    Post subject:
Reply with quote

HI,

I THINK TO_DATE RETURNS ONLY TIME-STAMP VALUE. U HAD GIVEN A VALUE WHICH IS NOT IN TIMESTAMP FORMAT. PLEASE THINK IN THIS WAY I HOPE U WILL GET SOLUTION FOR UR ERROR.


IF ANY BODY FEEL THIS IS WRONG PLEASE EXPLAIN THE CORRECT ONE TO ME.

THANKS,
PRASANNA.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us