Skip to Content
avatar image
Former Member

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

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 😊

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 25, 2009 at 10:08 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 25, 2009 at 10:05 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 25, 2009 at 08:26 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded