Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have an sql query which produces date in form of "MMYYYY". I want this value to pass through or output to one of the column in tMap as MM-YY. (The hypen should be inserted between month and year , and the year value should be taken the last two digits of the year).
Can someone help in how to handle this , if in tMSSQLROW or though string handling in tMap.
Example :- What I am looking for is :-
122019- should be "12-19"
012020- should be "01-20"
Note:- I have tried to accomplice with the format function of SQL by making a custom query in the query box of tMSSQLRow but getting a Null value.
I am new to talend ,so I don't know if the above makes sense. But if it is , please let me know if someone has any suggestions.
In a tMap it could be a Java expression like this:
inRow.inField.substring(0,2) + "-" + inRow.inField.substring(4,6)
The substring method takes the first character and one-past-the-last character, with a zero base.