Can someone help me with this [message #605477] |
Thu, 09 January 2014 13:40 |
|
pingiliarjun
Messages: 2 Registered: January 2014 Location: Software Engineer
|
Junior Member |
|
|
When I run the below Query
UPDATE INT.TABLE_NAME
SET CREATE_DTTM = TO_DATE(TO_DATE(TO_CHAR('20130111'),'YYYYMMDD'),'DD-MON-YYYY HH24:MI:SS')
WHERE FILL_DT <='20131231'
I am getting output as
11-JAN-0013 00:00:00 but the output should be 11-JAN-2013 00:00:00
If you see the year it is 0013 which is incorrect. Can someone help me with this.
Thanks
|
|
|
|
|
Re: Can someone help me with this [message #605480 is a reply to message #605478] |
Thu, 09 January 2014 13:51 |
|
pingiliarjun
Messages: 2 Registered: January 2014 Location: Software Engineer
|
Junior Member |
|
|
The CREATE_DTTM datatype is date.
The complete update query is
UPDATE RX_CLAIM_PRE_LOAD
SET CREATE_DTTM = TO_DATE(TO_DATE(TO_CHAR(RX_FILL_DT_SK),'YYYYMMDD'),'DD-MON-YYYY HH24:MI:SS')
WHERE RX_FILL_DT_SK <='20131231'
AND CREATE_DTTM > TO_DATE('01/03/2014 00:00:00','MM/DD/YYYY HH24:MI:SS');
The RX_FILL_DT_SK is number. So I am converting a number to character and then date.
[Updated on: Thu, 09 January 2014 13:52] Report message to a moderator
|
|
|
|
|
|