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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am


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