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: 
Chinnu3
Contributor III
Contributor III

Date format is needed in one way through script

Hi All,

I have 2 data sets having 2 different date formats i need to make those 2 into one format

Example 1 :- 08/02/2022 (MM/DD/YYYY)

Example 2:- 08-02-2022 (MM-DD-YYYY)

but I need only one format for both like  08/02/2022 (MM/DD/YYYY)

Chinnu3_0-1659518347323.png

Thanks in Advance.

 

Labels (3)
1 Solution

Accepted Solutions
sidhiq91
Specialist II
Specialist II

@Chinnu3  Please see below. You can use Alt() function to get this done.

NoConcatenate
Temp:
Load Date(Alt(Date#(Date_field,'MM/DD/YYYY'),
Date#(Date_field,'MM-DD-YYYY')),'MM/DD/YYYY') as [Effective Date]
Inline [
Date_field
08/02/2022
08-02-2022
];

Exit Script;

This should resolve your issue, if yes please like and accept it as a solution.

View solution in original post

1 Reply
sidhiq91
Specialist II
Specialist II

@Chinnu3  Please see below. You can use Alt() function to get this done.

NoConcatenate
Temp:
Load Date(Alt(Date#(Date_field,'MM/DD/YYYY'),
Date#(Date_field,'MM-DD-YYYY')),'MM/DD/YYYY') as [Effective Date]
Inline [
Date_field
08/02/2022
08-02-2022
];

Exit Script;

This should resolve your issue, if yes please like and accept it as a solution.