Display date format

Hi all
The date column contains values such as 31-12-4712, 10-12-2012, (real date) etc.
In the output (tab delimitted format), I need to put Null for 31-12-4712 and display dates otherthan 31-12-4712 as actual values
Can I use decode to achieve the above or is there is a better method to achieve the above
Thanks in advance
regards
anna

Hi,
Oneway
with dat as(
select to_date('31-12-4712','DD-MM-RRRR') x from dual union all
select to_date('10-12-2012','DD-MM-RRRR') from dual)
select
case when x=to_date('31-12-4712','DD-MM-RRRR') then
null
else x
end x
from datTwinkle,
I think with decode it will change the return type to varchar.
Decode might not be the ideal way (but as always it depends :) )
with dat as(
select to_date('31-12-4712','DD-MM-RRRR') x from dual union all
select to_date('10-12-2012','DD-MM-RRRR') from dual)
select
case when decode(x, to_date('31-12-4712','DD-MM-RRRR'),null,x) >'00-00-00' then
to_char('GONE')
else
to_char(x,'DD_MON_YYYY')
end y
from datRegards,
Bhushan
Edited by: Buga added decode example

Similar Messages

  • Change display Date format from 06.2011 to june 2011 in output of Query

    Hi All,
                Change display Date format from 06.2011 to june 2011 in output of Query  Execution. i used time charcteristics 0calmonth in query, output display is coming 06.2011, i want to display output in june 2011 format, anyone tell me how to convert this Date format.

    Hi Nandish,
    as tibollo said you just need to mark 0CALMONTH with text in RSD1.
    Kindly note that you don't need to do data load for this object.
    It will automatically derive by system.
    Just change the Info object 0CALMONTH in RSD1, Go to Master Data/text column and check mark on with text.
    Then activate it.
    Regards,
    Ashish

  • To Display Date format YYYY/MM/DD in Report

    Hi All,
    I wrote start routine code for field Document Date(ZDOC_DATE) to display date format YYYY/MM/DD ,but it displaying as 20090212.But my requirement is the date format should display 2009/02/12.
    Please find the below code which i have written,
    data : v_month(2) type n,
           v_year(4) type n,
           v_day(2) type n,
           v_Doc_Date(8) type c.
           v_month = ITAB-DOC_DATE+4(2).
           v_year = ITAB-DOC_DATE+0(4).
           v_day = ITAB-DOC_DATE+6(2).
           concatenate v_year v_month v_day into v_Doc_Date.
    result value of the routine
      RESULT = v_Doc_Date.
    Can any one please suggest  to display the date format as 2009/02/12.
    Thanks in advance
    karuna.

    Hi Rathy,
    As per your suggestion i have changed the document date lenght 10 & changed code ,the issue has been resolved now..date format showing 2009/03/22.
    data : v_month(2) type n,
    v_year(4) type n,
    v_day(2) type n,
    v_Doc_Date(10) type c.
    v_month = ITAB-DOC_DATE+4(2).
    v_year = ITAB-DOC_DATE+0(4).
    v_day = ITAB-DOC_DATE+6(2).
    concatenate v_year '/' v_month '/' v_day into v_Doc_Date.
    condense v_Doc_Date.
    result value of the routine
    RESULT = v_Doc_Date.
    Thanks for your quick response.
    Thanks to all.
    karuna

  • Screen display date format

    ADDT does not change the display date format when I set it in th ADDT Control panel.
    Control panel settings:
    Database date format: yyyy-mm-dd
    Screen date format: mm/dd/yyyy
    Display output: yyyy-mm-dd
    Is output does not change regardless of th esetting in control panel.
    Please advise.
    Simon

    hello
    ok here is another solution:
    Go to the binding panel and select the Dynamic Text that retrieved from the recordset to display the date in your page.
    - move your cruiser to the dead right end then you will found a bold down arrow beside the dynamic text click it you will found:
    - dropdown menu >> click Developer toolbox >>> Date Formate
    this will apply the settings you have made in the Control panel to this specified Dynamic data...
    i did it and works very fine now...

  • Display Date format problem - 'dd/mm/yyyy'

    Hi All,
    I want to display the date in this format dd/mm/yyyy. Below is the code which i declared in the JSPX.
    <af:selectInputDate value="#{bindings.poRequestedDateH.inputValue}" id="poRequestedDateH" required="true"
    binding="#{backing_POMasterDetail.poRequestedDateH}"
    validator="#{backing_POMasterDetail.assignedDateValidator}">
    <af:validator binding="#{bindings.poRequestedDateH.validator}"/>
    <af:convertDateTime pattern='dd/mm/yyyy'/>
    </af:selectInputDate>
    but when i select the date from the component its displaying like this .
    For Example : "09/47/2008", if i reload the page again and selecting the date its displaying some junk values in month column.
    Please anyone help me to fix the problem.
    Thanks & Regards
    Vimalan Balan

    Hi Vimalan,
    I just replied to the comment you posted on my blog:
    "How To Specify a Second Date Pattern in ConvertDateTime"
    http://blogs.oracle.com/Didier/2007/02/01#a213
    Your pattern is incorrect.
    In 'dd/mm/yyyy', 'mm' represents the minutes, not the months, represented by 'MM'.
    You can check it with the following pattern: "dd/MM/yyyy HH:mm:ss" that will display the months and the minutes:
    f.ex. "16/04/2008 16:47:08"
    So just change your pattern to "dd/MM/yyyy" and it will work.
    Please note that my blog was about adding a second pattern to convertDateTime.
    If your aim is to use one (and only one) pattern "dd/MM/yyyy", I would specify it at the ADF Business Components level, in the "Control Hints" tab of the date attribute, in "Format".
    Regards,
    Didier.

  • Display Date Format in JSP

    I've got a date that is being displayed as YYYY-MM-DD in spite of having set it to be displayed as MM/DD/YYYY in both the VO and EO. I've edited my formatinfo.xml file, and the format is there, but for some reason on this one date field (others are working fine) the changes aren't getting propogated to the JSP. I've changed the display label, and that change IS getting propogated out. I know this has to be simple...what am I missing?

    Maybe you need to configure that "application"? Or if you actually have access to the source code, then just take a look in it.
    Without any more details about the "application" we can't help you any much further.
    Generally, when you want to convert a Date or Calendar object to a human readable String, the SimpleDateFormat [1] is been used.
    [1] http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html

  • Date format in Data Manager

    Hi Guru's
    Does anyone know how can we set up date format in DataManager?
    At present its MM/DD/YYYY..
    Whenever we put any date in field we can put  it in DD MM YYYY format but when we save it it comes as MM DD YYYY..
    How can we change this ..Any clues??
    Regards
    Vikrant M Kelkar..

    Hi Simona,
    When you say MDM supports format..Where does it support????? ..I think it supports only while importing ..
    My requirement was I want to display date format in Datamanger in DD.MM.YYYY.
    Even though you import date in DD.MM.YYYY format its still displays it in MM/DD/YYYY in dtatmanger..
    What you are saying is during Import and not in ADta Manager..
    Hope i have not confused!!
    Regards
    Vikrant M Kelkar..

  • Date format and Alignment Change in the Excel Output.

    Hi Forum,
    Greetings to You!!!
    I was created one RTF format file. In this i have to display date format as (dd-mon-yyyy) in the excel output and also some data in the column have varchar2 and numbers. When i generate the output in html, pdf format using the xml file its coming fine.
    When i generate the output in excel format then date format is changing to dd-mon-yy and who have data in number format is automatically going to rtight alignment.
    But client need all the date output in the left alignment (dd-mon-yyyy) ..Please advice me ..
    Thanks & Regards,
    Nag.CH

    Hi Helios,
    Thanks for giving reply. We are using 11.5.10.2 Application . We are not using any ADI..I just run the xml file in my local system itself in excel format..Date format is coming dd-mon-yy.Not in Apps environment.
    Thanks,
    Nag

  • Controlling the Date Format

    Hi
    A sample web dynpro application displays information regardding Flight information with the flight date.
    This application is integrated in portal too.
    However, there is a requirement that end user can adjust the date format as yyyy-mm-dd or dd-mm-yyyy or mm-dd-yyyy format.
    I changed these options in Windows Regional settings to different values for the short date and long date formats. Unfortunately these changes do not reflect in the iView.
    Is ther any setting at the iView when developing the portal content or any other way to allow the user to see the date in the format he likes ? if yes, what needs to be done ?
    Thanks
    Prasad

    Hi Prasad,
    Try to use the browser locale setting instead of Windows regional setting.  You can get the browser locale
    setting from the below code
    Locale locale = request.getServletRequest().getLocale();
    Then use this locale data pattern and display date formats according to user browser locale settings.
    Hope this helps.
    Siva

  • How to display date field in ALV in format 'YYYY-MM-DD'?

    Hi experts,
    I am not getting displayed the date field in ALV in the format 'YYYY-MM-DD' if it is different than my user setting's format (DD.MM.YYYY).
    Tried with the edit mask
    LVC_S_FCAT-EDIT_MASK = '____-__-__'  but it does not work.
    I could not find the conversion routine for this. Is it possible to write customer conversion routine?
    I have to use DATE field, otherwise if I display this format in CHAR10 field , sorting in ALV does not work for this field.
    PLEASE ANY HELP!
    Kind regards,
    Danijela

    Hi,
    Use FM FORMAT_DATE_4_OUTPUT.
    TYPE-POOLS : slis, KKBLO.
    TYPES: BEGIN OF t_data,
           sel     TYPE char1,
           matnr   TYPE matnr,
           bldat   type char10,
           END OF t_data.
    DATA: it_tab TYPE STANDARD TABLE OF t_data,
          it_fcat TYPE slis_t_fieldcat_alv.
    DATA: wa_tab TYPE t_data,
          wa_fcat TYPE slis_fieldcat_alv,
          wa_layout type SLIS_LAYOUT_ALV.
    data: lv_repid    TYPE syrepid.
    data : lv_date    type NLEI-IBGDT,
           lv_outdate type RN1DATUM-DATEX,
           lv_format  type RN1DATUM-FORMAT value 'YYYY-MM-DD'.
    lv_repid = sy-repid.
    lv_date = sy-datum.
    CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
      EXPORTING
        datin         = lv_date
        format        =  lv_format
    IMPORTING
       DATEX         = lv_outdate.
       move lv_outdate to wa_tab-bldat.
    wa_tab-matnr = '0000001'.
    APPEND wa_tab TO it_tab.
    lv_date = sy-datum + 1.
    CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
      EXPORTING
        datin         = lv_date
        format        =  lv_format
    IMPORTING
       DATEX         = lv_outdate.
       move lv_outdate to wa_tab-bldat.
    wa_tab-matnr = '0000002'.
    APPEND wa_tab TO it_tab.
    lv_date = sy-datum + 2.
    CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
      EXPORTING
        datin         = lv_date
        format        =  lv_format
    IMPORTING
       DATEX         = lv_outdate.
       move lv_outdate to wa_tab-bldat.
    wa_tab-matnr = '0000003'.
    APPEND wa_tab TO it_tab.
    wa_fcat-fieldname = 'SEL'.
    wa_fcat-ref_fieldname = 'XCHPF'.
    wa_fcat-ref_tabname = 'MARA'.
    wa_fcat-edit = 'X'.
    wa_fcat-checkbox = 'X'.
    APPEND  wa_fcat TO  it_fcat.
    CLEAR :  wa_fcat.
    wa_fcat-fieldname = 'MATNR'.
    wa_fcat-ref_fieldname = 'MATNR'.
    wa_fcat-ref_tabname = 'MARA'.
    APPEND  wa_fcat TO  it_fcat.
    CLEAR :  wa_fcat.
    wa_fcat-fieldname = 'BLDAT'.
    wa_fcat-ref_fieldname = 'BLDAT'.
    wa_fcat-ref_tabname = 'BKPF'.
    APPEND  wa_fcat TO  it_fcat.
    call 'REUSE_ALV_GRID_DISPLAY'' after this
    Edited by: Ankur Parab on Oct 1, 2009 2:50 PM
    Edited by: Ankur Parab on Oct 1, 2009 2:51 PM

  • Table date format - How can I display Week 1, Week 2, instead of the date?

    I would like to creat a table for my Gantt, that displays the week number unit, as I have as the middle tier in my timescale on the Gantt side of the view.  I cannot find how to do this anywhere.  I know I can change the way the date is displayed,
    format wise, while in the table edit area, however one of the choices is NOT the week #.  The data must exsist as the timescale displays it! 
    My goal is to creat a table that instead of showing the start date for a task, displaces the start week: i.e. Week 1, Week 2, ...ect.
    Any help is appreciated,
    Craig.

    Craig --
    Bad news, my friend.  What you want to do with the date format in the table cannot be done.  The format you see in the Timescale bar is simply not an available date option in any table.  Sorry.
    Dale A. Howard [MVP]
    VP of Educational Services
    msProjectExperts
    http://www.msprojectexperts.com
    http://www.projectserverexperts.com
    "We write the books on Project Server"

  • How Do I Display HTML Formatted Text From A Data Table In Crystal Reports?

    I'm creating reports in Crystal XI.  The information being displayed in the reports comes from data tables where the text is formatted in HTML.
    I've worked with Crystal Reports enough to know that HTML text pulled from a data table doesn't appear in Crystal the same way it does in a web browser.  Crystal Reports ignores all the tags (...unless I'm missing something...) and just displays the text.
    Someone far more Crystal savy than I (...who I don't have access to...) came up with a Formula Field workaround that tricks Crystal Reports into displaying some basic HTML tags.  Here's that workaround:
    <!--
    stringVar TableName := ;
    TableName := Replace (TableName, "<ul>","<br> <br>");
    TableName := Replace (TableName, "<li>", "<br>   &bull; ");
    TableName := Replace (TableName, "</li>", "");
    TableName := Replace (TableName, "</ul>","<br> <br>");
    TableName := Replace (TableName, "<a", "<u><font color='blue'");
    TableName := Replace (TableName, "</a>", "</font></u>");
    TableName
    -->
    QUESTION - Does any similar workaround exist so I can display an HTML Table in Crystal Reports?  If not, is there any way to display HTML formatted text from a data table in Crystal Reports as it would appear in a web browser?

    Hi Steven,
    To display html text in Crystal Reports follows these steps.
    1. Right click on the field and select Paragraph tab.
    2. Under 'Text Interpretation' select 'HTML Text' and click OK.
    I have tried using the way,but it never works.So reply me if there is any way to solve the issue

  • In XML Forms Date Format want to display like this (dd-MMM-YY)

    Hi All,
    I created one Custom Property for Date and use that property in XML Form Builder. In the RenderList that Date Field Display as (Medium Format) showing like this Apr 21, 2009 Format.
    But i requirement is to display Date Field as like this 21-Apr-2009 (DD-MON-YEAR) Format.
    In the Custom Property i set the
    Additional Metadata (csv): +   customFormat=dd.MMM.yyyy but this way is not working for XML Forms.(Refered this SAP NOTES:816761)
    when the IE Browser language is English(United States) [en-us] Date Field Display as (Medium Format) showing like this Apr 21, 2009 Format.
    But when the IE Browser language is English(canada) [en-ca] Date Field Display as (Medium Format) showing like this 21-Apr-2009 Format. so this way is not a right way..
    I need to achieve this..  please help me.. Appreciate for helpful answer.
    Regards
    Thillai J

    Thillai:
    Refer to this post:
    https://www.sdn.sap.com/irj/scn/thread?messageID=1166540
    Hope this helps!

  • Export to excel issue - date format cannot be displayed properly

    Dear all,
    When we do a export to excel, if it has date format, we always have problem on displaying it in excel. Some of the date if we change the data format, it will be changed to the correct way. Others will remain the old data format. Any idea?
    I've checked the SAP note. It doesn't work. Thank you in advance.
    Regards,
    Yuka
    SAP Note:
    Click the Excel symbol in the task bar in Business One
    Save the file as ".txt"
    Open Excel and open the file as a ".txt" (Select in "Files of type" All Files (,))
    In the Text Import Wizard Select "Delimited" and for "Start import at row" 1.
    Click "Next"
    In the Text Import Wizard - Step 2, select 'tab' in "Delimiters", for "Text qualifier:" choose ""
    Click "Next"
    In the Text Import Wizard - Step 3, highlight the Date column and in "Column data format" check the radio button Date in the drop down menu beside Date you can set the date format you require
    Click "Finish"

    Dear Yuka,
    You may check this thread:
    Re: Incorrect date format in excel reports
    Thanks,
    Gordon

  • Date Format was not displayed correctly

    Hi All,
            We are developing WebDynpro Application successfully....but the date format was not displayed correctly.
    the RFC Date format is : 05/23/2007
    but in webdynpro we are getting date is wrong....we are getting date is : 09/05/2008.
    the below one is our coding for date display format.....
    public java.lang.String DisplayingDateFormat( java.lang.String date )
        //@@begin DisplayingDateFormat()
                        // Current date Format in BW
    SimpleDateFormat sdf = new SimpleDateFormat("MM.dd.yyyy");
    String ChangedDateFormat=null;
    try{
    //Parsing String to Date
    Date sqlDate =sdf.parse(date);
    Locale userLocale=WDClientUser.getCurrentUser().getLocale();
    DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.DEFAULT, userLocale);
    //Converting Date to String
    String newDateString = dateFormat.format(sqlDate);
    ChangedDateFormat=newDateString;
    I mention my user country is Germany.
    can u tell me any one why we are getting wrong date.....
    Really i appreciate.
    Thanks and Regards,
    Abhiram.

    Too bad you can not offer yourself points. LOL

Maybe you are looking for

  • How to debug a form (servlet) in the Forms and Reports Server

    Hi: I have a new install of an application that ran perfectly on a different host using the Forms and Reports Server. I have installed the FRS on the new host and it is working fine. I can run the test form. When I run my actual forms app, I only get

  • Convert standard video files in to flv file at run time

    Hello All How can we convert standard video files in to flv file at run time like you tube and Google Video is there any script or tool to do this. This is urgent. I have one project in this project client requiring function like whatever standard vi

  • I don't know how to fix my iPod HELP!

    I was turning on my video iPod, just as I always do, and it start to do all of these weird tests. I may have held the center button too long and reset it, but nevertheless I am stuck on a screen that says "Accessorize Test" and below that there are t

  • Need to reinstall OS on new Mac Book air

    I purchased a new mac book air and migration assistant overwrote the whole hard drive.  I want to red o migration assistant and select only some applications.  How do i reinstall mavericks and all the applications to the original state? Computer came

  • Preparing for logic 7

    does anyone know of any precautions or settings i should take when setting up my powerbook for logic 7.1. My powerbook has been getting bogged down so I've bought an external hard drive for my audio and i'm formatting my hard drive and starting from