Page 1 of 1

DateToString function problem

Posted: Thu Jun 12, 2008 2:05 am
by jaysheel
Hi,

I am trying to convet an incoming Date('mm/dd/yy') in Varchar format to Date ('yyyy-mm-dd').
I have used the following function in transformer.

If IsNull(LNK_XFRM_REAL_EST_STORES_DM.store_open_dt) Then SetNull() Else StringToDate(LNK_XFRM_REAL_EST_STORES_DM.store_open_dt,"%mm/%dd/%yy") .

And I am getting the error :

main_program: Fatal Error: Added field has duplicate identifier():

Any idea what might be the problem. :shock:

Posted: Thu Jun 12, 2008 2:24 am
by ArndW
If you make the derivation just "SetNull()" then I am fairly certain the error will still be there. I think it has to do with your column name.

Posted: Thu Jun 12, 2008 2:28 am
by jaysheel
This string to date never worked for me correctly.
Even without that null handling it didnt work for me.
Same error. :(

Posted: Thu Jun 12, 2008 3:06 am
by ArndW
The point that I was trying to make is that your error has nothing to do with the DateToString() function.

Posted: Thu Jun 12, 2008 3:33 am
by ag_ram
The problem must NOT be because of the null handling logic, String to Date function in the Transformer Stage.

Please privide us any more error messages if you are able to find them.

Posted: Thu Jun 12, 2008 5:28 am
by sureshabbisetti
Hi,

Instead of SetNull() function try with default value like'0001-01-01'.
Please correct me if I am wrong?

Regards
Suresh

Posted: Thu Jun 12, 2008 5:40 am
by ag_ram
The problem is NOT because of SetNull() being used there. There is no need to substitute this implementation with default value.

We can not take any immediate conclusion of what problem is until author(jaysheel ) comes up with more error messages.

Posted: Thu Jun 12, 2008 6:21 am
by Sravani
Hi,

I think the problem is not with SetNull() but is with IsNull() function. Sometimes it does not recognize the null value in the input string. Instead SETNULL() try with the following
Len(Trim(LNK_XFRM_REAL_EST_STORES_DM.store_open_dt))=0

Hope it will work for you.

Thanks.

Posted: Thu Jun 12, 2008 6:48 am
by ag_ram
No Sravani,

The problem is NOT because of IsNull() funtion, either. And teh suggestion you provided is not correct and not needed at first.