Converting date to YYYYMMDD is SSIS

Hi ,
I have an input date for example 1/16/2015. i want  to convert it to 20150116. How can i do it in SSIS 2008 R2?

Use below in Derived Column Task: (Please replace my with your column name)
(DT_STR,4,1252)DATEPART("yyyy",(DT_DATE)my) +
RIGHT("0" + (DT_STR,4,1252)DATEPART("m",(DT_DATE)my),2) +
RIGHT("0" + (DT_STR,4,1252)DATEPART("d",(DT_DATE)my),2)
-Vaibhav Chaudhari

Similar Messages

  • Convert date from YYYYMMDD to DDMMYYYY

    Please help if anyone knows any function module to convert date from YYYYMMDD to DDMMYYYY format..
    Thanks in Advance,
    manjari

    Hello.
    Simply do like this:
    DATA: datum TYPE char10.
    WRITE sy-datum TO datum <format option>.
    <format options>:
    DD/MM/YY and MM/DD/YY:
    Both additions have the same effect. The date output has a two-digit year value and a separator. The separator and the order are taken from the definition for date output in the user master record.
    DD/MM/YYYY und MM/DD/YYYY:
    Both additions have the same effect. The date output has a four-digit year value and separator. The separator and the order are taken from the definition for date output in the user master record.
    DDMMYY und MMDDYY:
    Both additions have the same effect. The date output has a two-digit year value and no separator. The order is taken from the definition for date output in the user master record.
    YYMMDD:
    This addition provides a date output with a two-digit year value without a separator in the format YYMMDD.
    Regards.
    Valter Oliveira.

  • Convert date format YYYYMMDD to DD.MM.YYYY

    hi
    i was wondering is there a FM which convert date format YYYYMMDD to DD.MM.YYYY
    instead of u know cutting the YYYY and MM and DD and concatement them again

    Hi ,
    See this piece of code
    Data : w_date type dats value '20080903',
              w_date1(10),
    Constants : C(1) value '.'.
    w_date1 = w_date.
    concatenate w_date+6(2) w_date+4(2) w_date+0(4) into w_date1 separated by C.
    Write : / w_date1.
    With Regards.
    Alwasy Learner

  • How to convert date from "yyyymmdd" to "MM/DD/YYYY" format

    1. I have one BLDAT field in my internal table.
       its getting updated from input file.
    2. The value in the input file is like yyyymmdd.
       So the internal table field is filled like this
       "YYYYMMDD".
    3. After this,I have to compare this internal table  
       field with BSAD table.
    4. The BLDAT field in BSAD table is in the format of 
       "MM/DD/YYYY".
    5. the BLDAT field is having diff format in internal  table and BSAD table.So I am unable to check this value.
    How to convert it as like the BSAD table format."MM/DD/YYYY" format.
    Thanks in advance!!

    Using the WRITE statement
      data: gd_date(10).  "field to store output date
    * Converts date from 20020901 to 09.01.2002
      write sy-datum to gd_date mm/dd/yyyy.
    OR u can
    CONCATENATE gd_date+4(2) gd_date+6(2) gd_date+0(4)
    into gd_date seperated by '/' .
    Hope this helps.
    Kindly reward points and close the thread for the
    answer which helped u OR get back with queries.

  • Function module to change Date from YYYYMMDD to DD.MM.YYYY

    Hi
    PLease tell me the function module that will convert date from YYYYMMDD to DD.MM.YYYY
    Thanks

    Hi,
    data lv_date1 type sy-datum.
    data lv_date2(12).
    lv_date1 = '20070123'.
    concatenate lv_date16(2) lv_date14(2) lv_date1+0(4) into lv_date2
    separated by '.' .
    is what you require to do;
    now lv_date2 = 23.01.2007.
    Also look for conversion routine "CONVERSION_EXIT_PDATE_OUTPUT"
    EG: call function CONVERSION_EXIT_PDATE_OUTPUT
                             exporting input = lv_date1
                             importing output = lv_date2.
    Thanks,
    Anitha

  • How to convert date format dd.mm.yy into yyyymmdd?

    Hello experts,
    how to convert date format dd.mm.yy into yyyymmdd?
    Thanx
    Axel

    Hi
    go through these previous threads on similar question
    https://forums.sdn.sap.com/click.jspa?searchID=673529&messageID=1763194
    Date Conversion in Flat File
    converting the DATE(yyyymmdd) into MONTH(yyyymm) format
    Date Format Conversion from MM.DD.YYYY to YYYYMMDD
    gives clear idea
    Reagrds
    Kiran
    Message was edited by:
            ravi kiran naalla

  • How to convert date(YYYYMMDD) to system date format.

    I neet to convert the incoming date (<b>YYYYMMDD</b>) to the format in which we are diplaying in our system. (<b>User's sytem format</b>).
    Thanks in advance,
    Viven

    VALIDATE DATE
      temp_date = in_date.
      call function 'DATE_CHECK_PLAUSIBILITY'
           exporting
                date                      = temp_date
           exceptions
                plausibility_check_failed = 1
                others                    = 2.
      if sy-subrc <> 0.
        raise invalid_date.
        exit.
      endif.
    RETRIEVE USER PROFILE DATE SETTING
      select single datfm
             into   user_setting
             from   usr01
             where  bname = sy-uname.
    REFORMAT DATE ACCORDING TO USER PROFILE
      case user_setting.
        when '1'.
          out_date(2)   = in_date+6(2).
          out_date2(2) = in_date4(2).
          out_date+4(4) = in_date(4).
        when '2' or '3'.
          out_date(2)   = in_date+4(2).
          out_date2(2) = in_date6(2).
          out_date+4(4) = in_date(4).
        when '4' or '5' or '6'.
          out_date      = in_date.
      endcase.
    PS.
    <b>Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!</b>
    Hope this’ll give you idea!!
    <b>Pl... award the points.</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

  • Function module to convert date format from yyyymmdd to mmddyyyy format

    function module to convert date format from yyyymmdd to mmddyyyy format

    Hi Rajitha,
    Do like this
    Data: Var1 type sy-datum,
             var2(8) type c.
    var1 = sy-datum.
    Concatanate var1+4(2) var1+6(2) var1+0(4) into var2.
    write var2.
    Reward Points if this helps,
    Satish

  • Convert date format yyyy-mm-dd to yyyymmdd

    Hi All,
    Could you please tell me how to do the mapping format to  Convert date format yyyy-mm-dd to yyyymmdd
    or
    Please provide any UDF for this conversion.
    Thank you .
    Regards,
    Bharat Kumar

    HI ,
    You can easily do that by using the standard datetransformation fuction . in the  property of that function put your coming source and desired target format . However once you specify the source format then the source field should always be in thaat format
    Regards,
    Saurabh

  • How can I convert date in FOX (from DEC to date[DEC])

    Hi everyone!
    In my planning layout I have a field called "MYDATE" of the date-type "DEC: Calculation or amount field with comma and +/- sign" (-> BPS does not allow using DATS as date-type).
    Since I import that date from a different system, I have to use a temporary workaround field "WADATE" (WorkaroundDate) of type DEC (alternatively integer or float) which contains the date in a format YYYYMMDD (e.g. 20070604).
    How can I transfer the date from WADATE to MYDATE? I tried using FOX, but for some reason it does not work. When I use the following function, MYDATE remains empty:
    DATA TMPDATE TYPE F.
    DATA MYPROJECTS TYPE B906_PROJ.
    FOREACH MYPROJECTS.
    "MYDATE" is the field I want my date in
    "WADATE" is my workaround field that contains the date
    TMPDATE = {WADATE,000,0000000001,0000000001,001}.
    BREAK-POINT.
    {MYDATE,000,0000000001,0000000001,001} = TMPDATE.
    ENDFOR.
    Is it possible to solve my problem with FOX? Or do I have to work with an EXIT function?
    Best regards, Daniel

    Daniel,
    The better approach is the one Marc said but if you have tomake a work around work, I think you might need to try and define your temporary date variable as String and another for the converted date as of type of the final date.  I would not define any date type as float unless you can have part days and it is very important to have part days, integer might work by I would try String first myself.
    It has been a while but on a BW 3.5 project I had to do some manipulation to read the attribute value of material master data to get the launch date and use it to derive the start period (definited as type 0FISCPER) and proportion of month based on number of days remaining after launch date vs the # of days for the month.  I think I used string type function in FOX to derive some of the component...
    Hope this helps,
    mary

  • How to Convert Date (DD.MM.YYYY) to be just DD

    Hi experts,
    I have no idea how to convert Date format (DDMMYYYY) to be just DD.
    Example:
    I have date: 31.10.2009
    now i just want to show in report as 31.
    I just known if we just want to show month only, we could use the 0CALMONTH2. but how if i need the day only?
    Are there any way, either in query (BEx) or modeling (Routine/Formula in Update Rules or Transfer Rules) which could fulfill the requirement?
    Many thanks..
    Warm Regards,
    Tika

    Hi,
    go through the link below and modify according to your requirement
    Date conversion from YYYYMMDD to DD.MM.YYYY
    Regards,
    Marasa.

  • How to convert date to system format

    Is there any function module for converting the date in YYYYMMDD format to our own system format. eg. 21.07.2006

    Hi Abinaya,
    Use this func module <b>CONVERSION_EXIT_PDATE_OUTPUT</b>
    Please award points if u find it useful
    Regards,
    Viven

  • Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format

    Can any one tell me Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format?

    have a look at the WIKI FAQs...they are very useful
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abapDevelopmentand+Programming&
    For this it says:
    <i>How to convert a date to internal or external format?
    Use the functions modules CONVERT_DATE_TO_EXTERNAL or CONVERT_DATE_TO_INTERNAL
    to convert the date. When converting to external format, the date format from the user's user profile will be used. When converting to internal format, the result will be in YYYYMMDD format.</i>

  • Converting date format from in mapping

    hi xi friends.
    in my scenario i just want to convert date format from 12022007 which is file to 12.02.2007 which is in target bapi.
    waiting for u.
    bye.
    regards.
    seeta ram.

    Hi,
    if I understood you correctly you want to transform from ddMMyyyy (your format in the external file) to yyyyMMdd (format of ABAP datatype DATS):
    Then all you need to do is to use the standard function TransformDate (as already described above).
    Enter in the field "Format of source Date": ddMMyyyy
    Enter in the field "Target Format": yyyyMMdd
    That's it.
    Regards,
    Helmut

  • LSMW - Read Data vs Convert Date for DATES

    Hi everybody,
    I have a problem with my LSMW for a <b>date field</b>.
    In the .txt file it is defined as 01.01.1900.
    (I can change it, e.g. make 01011900 but at the end SAP wants to have 01.01.1900 as input)
    In the 'Maintain Source Fields' of my LSMW I defined it as a DDMY(010) field.
    When 'Reading the Data' you can choose to check Date Value -> YYYYMMDD
    When I <u>check</u> it, it gives:
    For 'Display Read Data': 19000101
    And after 'Convert Data' : 01011900
    When I <u>don't check</u> it, it gives:
    For 'Display Read Data': 01.01.1900
    And after 'Convert Data' : 191.01.0 (?!?)
    The fact is that in SAP it needs to be in following format: 01.01.1900 (so DD.MM.YYYY) so none of both solutions is right.
    Can anybody tell me how I should configure this LSMW that I can transfer dates properly?
    Thank you very much!
    Kind Regards,
    Caroline

    Hi Caroline,
    before doing upload change ur system settings to yyyy.mm.dd (just go to menu bar click on System->user profile->own data in this go for default ) and save it and do log off and log in ,
    and then go for source fields and specify the Date field length as 8 char,
    and then in mapping step for that particular field  write the code as per the below
    just change as per ur Target structure and Source structure and field name .
    Make sure that in ur input file the Date field is in the format of yyyy.mm.dd
    if not as91_ztable-AKTIV is initial.
    replace '.' with '' into as91_ztable-AKTIV.
    replace '.' with '' into as91_ztable-AKTIV.
    condense as91_ztable-AKTIV no-gaps.
    BALTD-AKTIV = AS91_ZTABLE-AKTIV.
    else.
    baltd-aktiv = '/'.
    endif.
    Thanks
    Naveen khan
    Message was edited by:
            Pattan Naveen

Maybe you are looking for