[resolved] Date value to int

Highlighted
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!

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads