Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

How to pass blank date to output

Highlighted
Eight Stars

How to pass blank date to output

Input and output field is string(50), its a date field, but uses string type.

 

In my input data, blanks are coming in this date field and it needs to be passed to output.

 

I have used below code in tMap but it didn't worked. Please help to resolve this issue.

 

row2.DiagnosisActivityStartDate == "" ? "" : TalendDate.formatDate("MM-dd-yyyy",TalendDate.parseDate("yyyy-MM-dd",row2.DiagnosisActivityStartDate))


Accepted Solutions
Highlighted
Sixteen Stars
Sixteen Stars

Re: How to pass blank date to output

"".equals(row2.DiagnosisActivityStartDate) || 
row2.DiagnosisActivityStartDate == null ? "" : TalendDate.formatDate("MM-dd-yyyy",TalendDate.parseDate("yyyy-MM-dd",row2.DiagnosisActivityStartDate))

TRF

View solution in original post


All Replies
Highlighted
Sixteen Stars
Sixteen Stars

Re: How to pass blank date to output

"".equals(row2.DiagnosisActivityStartDate) || 
row2.DiagnosisActivityStartDate == null ? "" : TalendDate.formatDate("MM-dd-yyyy",TalendDate.parseDate("yyyy-MM-dd",row2.DiagnosisActivityStartDate))

TRF

View solution in original post

Highlighted
Eight Stars

Re: How to pass blank date to output

WOwwwww TRF... it worked. Thank you very much again

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog