cancel
Showing results for 
Search instead for 
Did you mean: 

Plz give me UDF for Date Transform

praveenreddy_bk
Participant
0 Kudos

HI Frnds plz give me UDF for Date Transform

1) Convert from YYYY-MM-DDTHH:MM:SS+HH:MM to DDMMYY

2) Convert from YYYY-MM-DDTHH:MM:SS+HH:MM to YYYYMMDDHHMMSS

3) Autofill YYYYMMDD41NNNN

Where:

YYYYMMDD is converted from the source value YYMMDD and NNNN is the 4 digit incremental

number given in PI for all records which starts from 000001 (+1) to the last records in the source file.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Praveen,

You dont need a udf for this.

1) Convert from YYYY-MM-DDTHH:MM:SS+HH:MM to DDMMYY

input --> substring(0,10) --> DateTrans (Source Format: yyyy-MM-dd Target Format: ddMMyy) --> Output

2) Convert from YYYY-MM-DDTHH:MM:SS+HH:MM to YYYYMMDDHHMMSS

input --> substring(0,10) --> DateTrans (Source Format: yyyy-MM-dd Target Format: yyyyMMdd)

input--> substring(12,20) --> Date Trans(Source Format: HH:mm:ssTarget Format: HHmmss)

Then concat these two outputs.

3) Autofill YYYYMMDD41NNNN

Convert similarly as for 1) and concat with counter in whatever format you want.

Regards,

---Satish

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Praveen,

If you do not have to do any special validation for input data, try to use only TransformDate standard fuction. When you create a pattern, or even without creating a pattern, you can edit manually Format of Source Date, and Target Format, from TransformDate func. Check if this solve your problem.

Best regards,

Pedro Pereira