How to convert date to ccyymm format

Hi,
How to convert date to ccyymm format.
Thanks

dadivela wrote:
Re: How to convert date from ccyymm format to mmddyyI didn't inderstand. Date doesn't have any format. If you have a string in CCYYMM format, you would have to extract the YYMM from the string.
SQL> SELECT   SYSDATE,
  2           TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
  3           SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM
  4    FROM   DUAL
  5  /
SYSDATE   DATE_F YYMM
08-JUN-09 210906 0906You can use this string to convert it to date. Note that since DD part of your date was not their in the resultan string, the converted date will fall back to first of the month specified.
SQL> SELECT   SYSDATE,
  2           TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
  3           SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM,
  4           TO_DATE (SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3), 'YYMM') conv_Dat
e
  5    FROM   DUAL
  6  /
SYSDATE   DATE_F YYMM             CONV_DATE
08-JUN-09 210906 0906             01-JUN-09
SQL>Then convert the date into the required format using TO_CHAR Function
SQL> SELECT   SYSDATE,
  2           TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
  3           SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM,
  4           TO_DATE (SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3),
  5                   'YYMM') conv_Date,
  6           TO_CHAR(TO_DATE(SUBSTR(TO_CHAR (SYSDATE, 'ccyymm'),3),
  7                   'YYMM'), 'MMDDYY') New_Format
  8    FROM   DUAL
  9  /
SYSDATE   DATE_F YYMM             CONV_DATE NEW_FO
08-JUN-09 210906 0906             01-JUN-09 060109
SQL>Hope this helps.
Regarads,
Jo

Similar Messages

  • How to convert date from ccyymm format to mmddyy

    hi,
    How to convert date from ccyymm format to mmddyy

    Please don't multipost. This question has been answered in your first post.
    How to convert date to ccyymm format
    Regards,
    Jo

  • How to convert date in varchar format to TimeZone format?

    Hi,
    Iam having a date '14-05-08 09:46:35 AM' (in Varchar format). How to convert this date to TimeZone ('IYYY-MM-DD"T"HH12:MI:SS"Z"FX') format?
    For Example,
    My input date is '14-05-08 09:46:35 AM' and I need output as '2008-05-14T09:46:35Z'.
    How to convert this?
    Thanks in Advance.

    Hi,
    You would look up the TO_TIMESTAMP and the TO_CHAR functions in the SQL reference manual for the version you don't mention, and make up the solution yourself, rather than asking someone else to do your homework.
    Sybrand Bakker
    Senior Oracle DBA

  • 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

  • How to convert date dd.mm.yyyy TO Month ddth YYYY?

    hi friends,
    how to convert date into this format.
    ex:
    date : 04.11.2008
    has to convert as
    October 04th, 2008
    th has to be set SUPERSCRIPT.
    Plz any helps....
    Regards,
    Shankar.

    check this..FM
    CONVERT_DATE_TO_EXTERNAL
    or we can do this using split or concatenate functions like below
    *CALCULATING THE MONTH FOR THE BODY OF THE EMAIL MSG
      IF GD_EBODY_BB = '01' .
        GD_EBODY_BB = 'January' .
      ELSEIF GD_EBODY_BB = '02' .
        GD_EBODY_BB = 'February' .
      ELSEIF GD_EBODY_BB = '03' .
        GD_EBODY_BB = 'March' .
      ELSEIF GD_EBODY_BB = '04' .
        GD_EBODY_BB = 'April' .
      ELSEIF GD_EBODY_BB = '05' .
        GD_EBODY_BB = 'May' .
      ELSEIF GD_EBODY_BB = '06' .
        GD_EBODY_BB = 'June' .
      ELSEIF GD_EBODY_BB = '07' .
        GD_EBODY_BB = 'July' .
      ELSEIF GD_EBODY_BB = '08' .
        GD_EBODY_BB = 'August' .
      ELSEIF GD_EBODY_BB = '09' .
        GD_EBODY_BB = 'September' .
      ELSEIF GD_EBODY_BB = '10' .
        GD_EBODY_BB = 'October' .
      ELSEIF GD_EBODY_BB = '11' .
        GD_EBODY_BB = 'November' .
      ELSEIF GD_EBODY_BB = '12' .
        GD_EBODY_BB = 'December' .
      ENDIF .
    *ATTACHMENT SUBJECT LINE MODIFICATION
      IF GD_EBODY_CC = '01'.
        CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '02' .
        CONCATENATE GD_EBODY_CC 'nd' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '03' .
        CONCATENATE GD_EBODY_CC 'rd' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '31'.
        CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '21'.
        CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
      ELSE .
        CONCATENATE GD_EBODY_CC 'th' INTO GD_EBODY_CC .
      ENDIF .
    regards
    ansumesh
    Edited by: Ansumesh Kumar Samal on Nov 4, 2008 9:02 AM

  • 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 format into day in ssrs reports?

    Hi
    How to convert date format into day?
    10/01/2010 as like Monday like that?

    =weekdayname(datepart("w",Fields!mydate.Value))
    -Vaibhav Chaudhari

  • How to convert date format to MM/DD/YYYY

    Hi,
       How to convert date format to MM/DD/YYYY.
    Thanks,
    Senthil

    hi,
    tri with this function module
    data :l_date(10) type c
    CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
    EXPORTING
       DATE_INTERNAL                  = SY-DATUM
    IMPORTING
       DATE_EXTERNAL                  = l_date.
    this function module converts date from 20050601 to external format  which is specified in user profile
    cheers,
    sasi

  • How to convert data from a report in PDF which are specified on multiple lines ?

    It often occurs that in a report one detail entry is folded onto two subsequent lines.
    e.g.
      No.  
    Container          Lt Ht Tp F/E     Dam          Weight Temp     Bi Im First Seal     No. Cell     Booking ref.
    In Arr    id     A         Tml         PoL PD   PoD             C T L R F B                                                                                 
    1       XXXU123456-7  20 ST I F                        24.000                                  SLX11            1    25A     CVA12345  
    How does the conversion to Excel is going to handle this ?
    I need the second line of data in my excel sheet.
    YES               9/10   14:15        BEANR   REFCT

    Hello Jay,
    Don't use SSIS to convert. Use SSIS to FTP the files out.
    How you convert to PDF: the format is owned by Adobe so there might be royalties involved, but there are paid and free (OSS) libraries to doing so. Just search online.
    Arthur
    MyBlog
    Twitter

  • 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 sysdate to the format dd-mon-yyyy

    how to convert sysdate to the format dd-mon-yyyy

    <how to convert sysdate to the format dd-mon-yyyy>
    This question is better answered by thinking about about how Oracle dates work. SYSDATE is a pseudocolumn (function without any arguments) that returns a date value: it already is a date. Oracle date values are stored not as we see them, say 'DD-MON-YY', but as a series of bytes with the different date components from the millennium down to the second. We NEVER see dates as they are stored but use the formats for automatic conversion.
    To display a date the way you want use TO_CHAR() with an edit mask or as others suggested change your NLS_DATE_FORMAT (thought I advise against this as most systems use DD-MON-YY and porting queries from other systems or even OTN can easily break). To change a converted string back to a date use TO_DATE() with an edit mask.

  • How to convert exponent to number format

    Hi,
    how to convert exponent to number format.My column is in number and the data is in exponent format .for example  data is 2.44705130197009E18 .when i do field name haveing this data like
    select * from table name where filed name =2.44705130197009E18 ,field name  is of number (20) data type .but i am not getting any data fectched .
    your advice is at most appriciated .
    Regards,
    Suja

    Example of what I was saying...
    SQL> create table myexp (name number);
    Table created.
    SQL> insert into myexp values (2447051301970090001);
    1 row created.
    SQL> select name from myexp;
          NAME
    2.4471E+18
    SQL> col name format 9999999999999999999999999999999999999
    SQL> select name from myexp;
                                      NAME
                       2447051301970090001
    SQL>
    The number you are seeing as an exponent is not just the number that is stored with lots of 0's on it, there's other information you are missing, so you need to change your format to see the true value.

  • How to Convert Date to Month in Database which is pointing to EBS, Not DWH.

    Hi Friends,
    We are planning to create reports in OBIEE and the Source is EBS. That means, we don’t want to depends on Datawarehouse and Informatica and OBIApps. We just create some reports and they are pointing to EBS database.
    For testing purpose, we have taken one HR Report and it containsthe below columns:
    Month (Dim)
    Revenue Per Employee Headcount (Fact)
    Average Cost per Active Workforce Headcount (Fact)
    In my little investigation, we found that Revenue column is coming from EBS: GL_BALANCES. And we configured W_Day_D base table in DAC as there is no Month column in EBS (Not sure).
    *** Coming to my problem, how can I call Month column in my database pointed to EBS. How to convert Date to Month in my database.
    I could be wrong but anyone please look into this issue.. How can I create columns for that exact OBI report in EBS database instead of DwH.
    Thanks in Advance..
    Raghu Nagadasari

    Hi Veeresh,
    You are right. Here, no need of using W_DAY_D table, but, we need all the stuff from the table and to explain my problem i have taken that table as an example. Now, we ran scripts for W_MONTH_D and W_DAY_D tables with EBS columns. So, we are getting data for the tables. In the same manner we have to create scripts for the below tables.
    W_GL_ACCOUNT_D
    W_GL_OTHER_F
    W_STATUS_D
    W_MCAL_DAY_D
    W_EMPLOYMENT_STAT_CAT_D
    W_WRKFC_BAL_A
    W_DAY_D (Completed)
    W_MONTH_D (Completed)
    But, we are not aware of EBS Tables and their columns much. So, we are back tracing from RpD --> DAC --> Info --> EBS for each and every column and its taking much time.
    So, if anyone of you facing the same issue, please share the EBS tables for the corresponding OBI tables, which are mentioned above.

  • How to convert 12 hour time format to 24 hour time format ?

    Hi,
    How to convert 12 hour time format to 24 hour time format is there any FM if not, please suggest me how to convert .
    regards,
    rakesh

    Hi,
    Have you tried function module HRVE_CONVERT_TIME
    Input parameters will be like
    TYPE_TIME                       B
    INPUT_TIME                      01:00:00
    INPUT_AM_PM                  PM
    Output
    OUTPUT_TIME                     13:00:00
    Regards

  • How to convert date (dd/mm/yyyy) to week no. calendar?

    hi all,
    I have a question about if user enters 12/12/2004(dd/mm/yyyy), which week is that? I just know week no. should from 01 to no more than 53. How to convert date to week no.?
    Thanks

    select to_char(sysdate,'IW'),to_char(sysdate,'wW') from dual;
    for IW, the week 2 starts on the first monday after 1.Jan, for WW, the week 2 starts on 8. Jan.
    HTH
    Laurent Schneider
    OCM DBA

Maybe you are looking for

  • Latest Firefox (23.0.1) won't install

    Firefox crashed (not uncommon) so I went through the restart routine. It decided to install the latest version, got as far as "Checking Compatibility of Add Ons" and sat with the 'scanning green bar' sliding happily grpm end to end. After 6 hours I g

  • OSX 10.8 BUG REPORTING

    I am having a problem, mostly with Apple Mail.  I lose the ability to type.  Keyboard inop.  Sometimes it occurs with Chrome (sorry, until they fix Safari, Chrome works better.  I'd love a fully integrated browser, but it ain't here yet!). Restarting

  • TC losing connectivity

    After spending a few months working on what I thought was a backup issue (worked with Apple geniuses, service, friends, replaced TC) with TC (I'd get an error that the backup was delayed because the backup disk was unavailable), I've discovered that

  • Screen processing-Urgent

    Hi all, I have created two screens, in  one screen i have a mandatory field ...In this screen when i press Back or Exit or Cancel button in application tool bar, i should be able to go to my previous screen without entering any value in the mandatory

  • IDSM, Event Viewer locality=OUT , can I change it?

    Hello, in ISDM event viewer I see both internal (private) and external (global) addresses have "locality"=OUT. Does anybody know if it makes sense to change it and how, I can't find where?   participants:       attacker:         addr: 10.7.51.233  lo