on 04-15-2009 3:55 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.