Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can someone tell me how to convert tFileInputDelimited input string field formatted as dd-MMM-yy
to an output date field formatted as like mm/dd/yy using tMap?
Thank you.
TalendDate.isDate(incoming_row.incoming_col_value,"dd-MMM-yy") ? TalendDate.parseDate("dd-MMM-yy",incoming_row.incoming_col_value) : null and in the Date Pattern put the date format "mm/dd/yy" please see the attachment
Notes:
1) Your incoming value should be a string data type
2) your output port should be date data type
TalendDate.isDate(incoming_row.incoming_col_value,"dd-MMM-yy") ? TalendDate.parseDate("dd-MMM-yy",incoming_row.incoming_col_value) : null and in the Date Pattern put the date format "mm/dd/yy" please see the attachment
Notes:
1) Your incoming value should be a string data type
2) your output port should be date data type
Hi,
if you read the column with tFileInputDelimited as a Date and send it to the destination also as a Date, you do not need anything, just use different patterns. If your destination is a string - you need to use formatDate function (use tMap it contains a lot of predefined function templates)
https://help.talend.com/reader/nAXiZW0j0H~2~YApZIsRFw/JFWl8U3lEbhWZEFAUtYvMw
Hi Vapukov,
If we read the source data column value as date and if the date pattern do not match (the format / pattern we supply) it throws out an error and the whole record will be rejected, if we read it as string and then try to format it the way i prescribed then atleast the record will not be rejected though the specific column value goes as null
Please correct me if i am wrong...
Sorry to defer on this...In my proposed solution job will NOT fail but will only return null value for that specific date column if the pattern doesn't match, that is the whole advantage we are trying to bring to the table. Thanks for the response though.
Tnewbie,
OMG that worked.... your the best, THANK YOU!!!!
Profuse
Glad it worked for you...pls mark the issue as resolved so that it benefits some one else in need