Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us