[resolved] Date value to int

One Star

[resolved] Date value to int

Hi there !
I am using TOS for Data Integration for 4 weeks now, and i am really excited about it.
Before i used Oracle Warehouse Builder.
In OWB i did some calculations with date fields. (example: count how many days there are between two date fields)
I also convert the date values to a integer (in OWB: TO_NUMBER(TO_CHAR(INGRP1.REGISTRATION_DATE, 'YYYYMMDD')) ).
Is there a way to do the convert in Talend?
Thanks!
Best regards,
Dennis
P.S. i am using PostgreSQL

Accepted Solutions

Re: [resolved] Date value to int

in talend you would use java to do this (probably in a tMap)
Integer.parseInt(routines.TalendDate.formatDate("yyyyMMdd",row1.MY_DATE))
you may need to "fix" my syntax, not 100% sure that is exactly accurate.

All Replies

Re: [resolved] Date value to int

in talend you would use java to do this (probably in a tMap)
Integer.parseInt(routines.TalendDate.formatDate("yyyyMMdd",row1.MY_DATE))
you may need to "fix" my syntax, not 100% sure that is exactly accurate.
One Star

Re: [resolved] Date value to int

Thanks, this is the solution i was looking for !
It works really well Smiley Happy
Thanks!