Topic
  • 6 replies
  • Latest Post - ‏2014-04-30T10:17:07Z by Siva_007
kk411
kk411
22 Posts

Pinned topic DATETIME TO DATE

‏2013-07-31T19:08:14Z |

Hi ALL

I have a  Input XML File in  which the date is in format CCYY-MM-DD-HH-MM.

I need to covert it into CCYYMMDD.

INPUT:2013-07-15-05:00;

EXPECTED OUTPUT: 20130715

Iam trying different functions but unable to do that.Can anyone suggest the solution.

 

Thanks

Updated on 2013-08-01T00:53:07Z at 2013-08-01T00:53:07Z by kk411
  • ShyamSreenivasan
    ShyamSreenivasan
    2 Posts

    Re: DATETIME TO DATE

    ‏2013-08-01T06:50:06Z  

    On the output side where you want to map the date field change the format in the type tree to CCYYMMDD and map directly.

  • kk411
    kk411
    22 Posts

    Re: DATETIME TO DATE

    ‏2013-08-01T14:56:58Z  

    On the output side where you want to map the date field change the format in the type tree to CCYYMMDD and map directly.

    Thank you shyam!

  • lnagalla
    lnagalla
    3 Posts

    Re: DATETIME TO DATE

    ‏2013-08-03T14:46:18Z  
    • kk411
    • ‏2013-08-01T14:56:58Z

    Thank you shyam!

    Hi I prepared doing it in Map level instead of TypeTree changes.

    You can use the below function to do

    =LEFT(Date_field,4)+RIGHT(LEFT(Date_field,7),2)+RIGHT(LEFT(Date_field,10),2) it will gives the o/p like 20130715.

  • Bhoju
    Bhoju
    37 Posts

    Re: DATETIME TO DATE

    ‏2013-09-10T12:10:35Z  
    • lnagalla
    • ‏2013-08-03T14:46:18Z

    Hi I prepared doing it in Map level instead of TypeTree changes.

    You can use the below function to do

    =LEFT(Date_field,4)+RIGHT(LEFT(Date_field,7),2)+RIGHT(LEFT(Date_field,10),2) it will gives the o/p like 20130715.

    you can use function FROMDATETIME()  and do the magic

  • paul.brett
    paul.brett
    556 Posts

    Re: DATETIME TO DATE

    ‏2013-10-10T12:55:58Z  
    • lnagalla
    • ‏2013-08-03T14:46:18Z

    Hi I prepared doing it in Map level instead of TypeTree changes.

    You can use the below function to do

    =LEFT(Date_field,4)+RIGHT(LEFT(Date_field,7),2)+RIGHT(LEFT(Date_field,10),2) it will gives the o/p like 20130715.

    A working example , similar to the one mentioned above.

    Attachments

  • Siva_007
    Siva_007
    1 Post

    Re: DATETIME TO DATE

    ‏2014-04-30T10:17:07Z  

    Hi, Try this it may help you.

    =LEFT(Substitute(DATETOTEXT(Date), "-" , ""),8)

    thanks,

    007

    Updated on 2014-04-30T10:22:37Z at 2014-04-30T10:22:37Z by Siva_007