cancel
Showing results for 
Search instead for 
Did you mean: 

Date trans convert dd-mmm-yy (10-nov-08) to yyyymmdd

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (2)

Answers (2)

former_member187339
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.