Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert Current Date to dd-MONTH-YY Format

Hi Talend Coummunity,

 

Could you please help me on writing code for the below two date conversions in tMap. Please find the attached screen shot too.

 

1) From Current Date (System Date) to dd-MONTH-yy Format:

        Output needed: 29-MAY-19 (Target it Oracle and Data type is 'Date')

 

2) Date conversion from SQL Server (Source) to Oracle (Target - Data type is 'Date')

   From one of the column in SQL Server table (SSMS) date is populated as 2019-05-29 09:16:06.0000000.

   I need to bring / convert this date into dd-MONTH-yy Format.

           Output needed: 29-MAY-19 

    

Your help is greatly appreciated.

 

Thanks in advance.

Kumar

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

   The issue says that job is failing due to unparseable date format. This means the input date values of one of the three columns are having date in different format compared to what you have given there.

 

    If you are expecting null values for the date, I would recommend to add additional null check condition also for these columns.

  0683p000009M5Ce.png

 

I hope the answer has helped to resolve your original and current issue. Please spare a second to mark the topic as resolved as it is the best way to thank the Talend community members for sparing their time in between normal work for the queries 🙂

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

 

 

View solution in original post

3 Replies
Anonymous
Not applicable
Author

@uganesh 

 

Please try the below steps

0683p000009M5G1.png

 

0683p000009M42o.png

 

The functions used are:-

 

current date ->     TalendDate.getCurrentDate() 

output_date ->     TalendDate.parseDate("yyyy-MM-dd HH:mm:ss.SSSSSSS",row1.input) 

Note:- If you want to limit the month part to three characters, please use "dd-MMM-yy" instead of "dd-MMMM-yy" in the output flow.

 

Hope I have answered your query. Please spare a second to mark the topic as resolved 🙂

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

Anonymous
Not applicable
Author

Hi Nikhil,

I knew you are always be available for rescue and thank you for the reply.

Could you please take a look at the tmap attachment and let me know what is missing? 

 

Below is the error am getting:

java.lang.RuntimeException: java.text.ParseException: Unparseable date: "Edit"

 

 

Thank you

Kumar


tMap.PNG
Anonymous
Not applicable
Author

Hi,

 

   The issue says that job is failing due to unparseable date format. This means the input date values of one of the three columns are having date in different format compared to what you have given there.

 

    If you are expecting null values for the date, I would recommend to add additional null check condition also for these columns.

  0683p000009M5Ce.png

 

I hope the answer has helped to resolve your original and current issue. Please spare a second to mark the topic as resolved as it is the best way to thank the Talend community members for sparing their time in between normal work for the queries 🙂

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂