Page 1 of 1

Not Null date in source being recognized as null

Posted: Mon Jun 19, 2006 2:13 pm
by logic
Hi,
I am selecting some data from oracle table using user defined query through DRS stage. While selecting I am masking the date column with

Code: Select all

TO_CHAR(T1.IN_DT, 'YYYY-MM-DD HH24:MI:SS'). 
The date in source is 5/19/1997 , for example. In the transform for that column I have

Code: Select all

If IsNull(LINK_In_Txn2.IN_DT) or " " Then "1900-01-01 00:00:00" Else LINK_In_Txn2.IN_DT
.
I see the date in correct format if i view data at source or run the query outside datasatge. However the same date is written into the output sequential file as 1900-01-01 00:00:00. :(
Can anybody give a clue as to what might be happening or what might be causing this.
Thanks.

Posted: Mon Jun 19, 2006 2:27 pm
by kris007
Try

Code: Select all

If IsNull(LINK_In_Txn2.IN_DT) Or Trim(LINK_In_Txn2.IN_DT) ="" Then "1900-01-01 00:00:00" Else LINK_In_Txn2.IN_DT
HTH

Posted: Mon Jun 19, 2006 2:27 pm
by chulett

Code: Select all

If IsNull(LINK_In_Txn2.IN_DT) or LINK_In_Txn2.IN_DT = " " Then "1900-01-01 00:00:00" Else LINK_In_Txn2.IN_DT

Posted: Mon Jun 19, 2006 2:52 pm
by DSguru2B
If you are going for a user defined SQL, you might as well throw in a case statement in the sql itself and do this manipulation there.

Posted: Mon Jun 19, 2006 3:02 pm
by logic
Thanks all,
Worked perfect.