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

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads