on 10-25-2009 7:19 AM
Hi All,
I have seen a few discussion on forums and also tried date trans function
My requirement is date in incoming field is dd-mmm-yy (10-nov-08) and has to be converted to yyyymmdd
Can ne one pls help me out
You need to use std DateTrans function.
Take help of this blog and see example 1. Try other way around as said in example 1.
/people/sarvesh.singh3/blog/2009/02/13/yes-it-is-possible-with-datetrans-function
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravindra,
I gess datetrans in built function will be able to do this.
try this:
1. give source date format as ddmmmyy with date separator as "-"
2. target as yyyymmmdd
You need to manually put these values and do not use the standard. Try this, I don't have a PI box to do this
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravindra,
You can achieve this by writing a simple UDF.
But if you don't want to go for an UDF, then there is one more way of doing it :
1)First using 'Substring' function get the value 'nov' separately.
2)Use 'FixValue' to get the corresponding no of month. Eg: 11 for nov
In fixValue you can maintain these values of months.
3)Using 'substring', you can get the values of date and year separately.
4)Now these 3 separate values you can concatenate, and get the resultant date format as 'dd-mm-yy'(10-11-08).
5)Now using the 'TransformDate' function, you can get the required format as 'yyyymmdd'.
But this approach can be used if, incoming month value is alway 3 char ( mmm).
Regards,
Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.