cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping error when converting date format.

Former Member
0 Kudos

Hi all,

My date tranfer funcion source as yyyy-MM-dd and target as MMddyyyy.

when i tranfer date format using date trans funtinon, its working fine when i give date:2008-07-11 , i am getting correct value after mapping tranformation that is : 07112008

when i give source date as 0000-00-00(getting into the XI box) i am getting out put as: 11300002.

Thanks,

Dhanush

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member193376
Active Contributor
0 Kudos

Hi Dhanush

I think i have told how to validate your date.

if you have not understood, please reply.

Thanks

Saiyog

former_member193376
Active Contributor
0 Kudos

Hi

The situation will never arise when the date will be inputed as 0000-00-00. Ok, but just incase it does then you will have to validate it. You can use date compare function. here you provide your date(1st input) and then compare it with a hard coded constant, ie 0000-00-00(2nd input) and it will return 1 or zero. 1 meaning false and 0 meaning true, then further check if its 0 or 1 and if its 0, ie true you input your date and date transform function and map it to your target.

Hope this will help you

Thanks

Saiyog

Former Member
0 Kudos

Hi,

0000-00-00 is not the correct date format. If you get the input like this then you need to compare the input with constant 0000-00-00, if both are equals then map constant 00000000 to the output else use DateTrans and map to the output or the alternate way is to define a java udf.

thanks

amit

reward points if answer is useful

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi,

validate your mapping if date is different of 0000-00-00 do the date transformation.

Thansk

Rodrigo

Shabarish_Nair
Active Contributor
0 Kudos

in case u want a validation, in the standard function -> Show Advanced Properties and uncheck calendar is lenient.

Former Member
0 Kudos

Hi Rodrigo,

could you please tell me how to validate. validate your mapping if date is different of 0000-00-00 do the date transformation.

Thanks,

Dhanush.

Former Member
0 Kudos

Hi Dhanush,

Please use the if without else function, check if the value is 0000-00-00 if so dont transform it else transform it and send it to the target field.

thanks

amit

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi

do this

date--


equalsnot-ifWhitOutElsetrasformatioDate-Date

00-00-0000-----

it should solve ur problem

if so, please assign points and close the post!!

Thanks

Rodrigo