How to pass blank date to output

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
Fifteen Stars TRF
Fifteen 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

All Replies
Fifteen Stars TRF
Fifteen 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
Eight Stars

Re: How to pass blank date to output

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

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