One Star

[resolved] convert bigdecimal yyyymmdd(20110701) to date (yyyy-mm-dd)2011-07-01

hi,
is there a way to convert bigdecimal yyyymmdd(20110701) format to data format like this (yyyy-mm-dd)2011-07-01, using tmap componement?
Thanks for help
3 REPLIES
One Star

Re: [resolved] convert bigdecimal yyyymmdd(20110701) to date (yyyy-mm-dd)2011-07-01

Hi
Welcome to Talend Community!
The expression may be a little complex but works fine.
TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("yyyyMMdd",row1.newColumn.toString())))

Regards,
Pedro
One Star

Re: [resolved] convert bigdecimal yyyymmdd(20110701) to date (yyyy-mm-dd)2011-07-01

Hi,
I have also faced same problem to convert the bigdecimal into date format.
i have executed the provided code in tmap component, but unfortunately it doesn't work and i have got the below error "Exception in component tRowGenerator_1".
Please help us
Thanks in advance
Siva
Seven Stars

Re: [resolved] convert bigdecimal yyyymmdd(20110701) to date (yyyy-mm-dd)2011-07-01

Create a new topic and give full details of the exception. What type is it? What line of code triggers it? Screenprint your job and settings too.