Date format in apex items

Hi,
i have a Problem with the formating of a table colum.
  , NVL2(p.buchungsdatum,
      APEX_ITEM.DISPLAY_AND_SAVE(8,TO_CHAR(p.abschlussdatum,'DD.MM.YYYY')),
      APEX_ITEM.DATE_POPUP(8,rownum,p.abschlussdatum,'DD.MM.YYYY',15,30)) abschlussdatum
If i click on the header in the table, becaus i want to sort the entries asc or desc, the sorting is alpha numeric not numeric. I need the sorting function in  APEX_ITEM.DISPLAY_AND_SAVE AND in APEX_ITEM.DATE_POPUP
What can i do specially hier
APEX_ITEM.DATE_POPUP(8,rownum,p.abschlussdatum,'DD.MM.YYYY',15,30)) abschlussdatum
THX
René

user10457644 wrote:
Please update your forum profile with a real handle instead of "user10457644"
Include two columns in the report query, one containing the original value, and one to generate the formatted control:
  , p.abschlussdatum
  , NVL2(p.buchungsdatum,
      APEX_ITEM.DISPLAY_AND_SAVE(8,TO_CHAR(p.abschlussdatum,'DD.MM.YYYY')),
      APEX_ITEM.DATE_POPUP(8,rownum,p.abschlussdatum,'DD.MM.YYYY',15,30)) abschlussdatum_ctrl
Hide the ABSCHLUSSDATUM_CTRL column, and set the HTML Expression attribute for the ABSCHLUSSDATUM column to #ABSCHLUSSDATUM_CTRL#. Ensure the Display Text As column attribute is Standard Report Column rather than the default Display as Text (escape special characters), and the Strip HTML report attribute is set to No.
The ABSCHLUSSDATUM column will then display the ABSCHLUSSDATUM_CTRL form control, but be sorted using the original ABSCHLUSSDATUM date value.

Similar Messages

  • How to convert Date format in Apex?

    Hi All,
    I have created a Date picker item in Apex as "dd-mm-yyyy", Now when they select this date picker it has to convert into "Day,Month DD, YYYY".
    I have trired like this but it is not wroking, can any one help me to get this to be done.
    Under the item we have option as#
    Default value: to_char(to_date(:P1_ENG_DATE,'dd-mm-yyyy'),'Day,Month DD, YYYY')
    Deafult value as -PL/Sql type.
    Thansk,
    Anoo..

    Hi Tauceef,
    I am having proble now, currently i am apex version 3.0 in that i am un able to find the option "Use application date format"
    How i can reolsve this problem in this version.
    I will be very greatful if u can help me out to resolve this problem.
    Note: Team is not willing to upgarde the apex version.
    Thanks,
    Anoo..

  • Invalid date format after APEX upgrade

    We are currently working on upgrading our applications from 1.6 to the new APEX 3.2 version. After the upgrade of one of our systems I have a tabular form that is returning the error 'Invalid date format found'. The date that is getting entered into the system is being displayed and choosed via a sql popup. The code for the pop up is
    SQL CODE
    create or replace view next_weeks as
    with t as (
    select
    trunc(sysdate) + (rownum - 1) / 2 d
    from
    dual
    connect
    by rownum <= 28)
    , call_info as (
    select
    c.call_identifier, c.callback_date, c.callback_cancelled
    from uid_csr_schedule c
    select
    to_char(d, 'fmDy MM/DD/YYYY AM') l
    , to_char(d, 'dd-mon-yy hh:mi:ss AM') v
    ,to_char(d, 'mm/dd/yy hh:mi:ss AM') o
    from
    t
    where
    ((select count(callback_date) from call_info ci where ci.callback_date = t.d
    and (ci.callback_cancelled is null or ci.callback_cancelled !='Y'))) <
    (select csr_calls_per_period from uid_sch_system_default)
    minus
    select
    to_char(d, 'fmDy MM/DD/YYYY AM') l
    , to_char(d, 'dd-mon-yy hh:mi:ss AM') v
    ,to_char(d, 'mm/dd/yy hh:mi:ss AM') o
    from
    t
    where
    (select count(callback_date) from call_info ci where ci.callback_date = t.d
    and (ci.callback_cancelled is null or (ci.callback_cancelled !='Y')))
    =(select override_amt from uid_sch_call_override
    where (to_char(begin_date,'dd-mon-yy') || ' ' || upper(period)) = to_char(t.d, 'dd-mon-yy AM'))
    union select
    to_char(d, 'fmDy MM/DD/YYYY AM') l
    , to_char(d, 'dd-mon-yy hh:mi:ss AM') v
    ,to_char(d, 'mm/dd/yy hh:mi:ss AM') o
    from
    t
    where
    ((select count(callback_date) from call_info ci where ci.callback_date = t.d
    and (ci.callback_cancelled is null or ci.callback_cancelled !='Y'))) >=
    (select csr_calls_per_period from uid_sch_system_default)
    and
    (select count(callback_date) from call_info ci where ci.callback_date = t.d
    and (ci.callback_cancelled is null or (ci.callback_cancelled !='Y')))
    <
    (select override_amt from uid_sch_call_override
    where (to_char(begin_date,'dd-mon-yy') || ' ' || upper(period)) = to_char(t.d, 'dd-mon-yy AM'))
    order by o
    The form then has the item set as a popup with a date format mask of dd-MON-yy hh:mi:ss AM. The popup displays fine and the date is shown in the field but the error is received when I try to save the information. If I change the application global setting of date format mask to dd-MON-yy hh:mi:ss AM then this error goes away however, it creates problems on all the rest of my pages that use this date in the where clause of the queries. Is there a way to solve the problem above without having to change the globalization parameter or do I need to change this parameter and then redo those queries?
    Thanks for your help!
    Amber

    Amber,
    It's interesting that the problem goes away if you set the global date format to be the same as the column level. The column level should trump the global setting. What process is returning the error? Are you sure it's the MRU or could it be something custom?
    You could consider adding a process before the MRU fires that uses alter session to change the date format.
    Regards,
    Dan
    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/

  • Date format in apex 4.1

    hello
    we have custom table for an apex application. In that table we have DATE type for column1(for eg)
    When column1 is inserted via APEX, we use standard apex date picker and DD-MON-RRRR format. After we insert and when we refreshh the apex page to see
    we see values like 10-OCT-10 not 10-OCT-2010,,
    any idea or fix..
    I tried in the source sql select  statement [for that region]  with to_date(column1,'DD-MON-YYYY') ..but was not successful
    Also i followed same for insert statment with no luck
    please advise
    kp        

    Hi,
    As you mentioned, its a date field in column, there are two approaches.
    Method1: Go to your report attributes, click the pencil icon next to it and look
    In Column Attributes Block:Number/Date Format
    Method2: As its a date field, change like this in your report query
    to_char(column1, 'DD-MON-YYYY')

  • Date format in text item-solved

    Two text item with data type date.I insert dates in the text item in the format for ex.
    01-jun-07 but the text item takes it as 01-jun-0007.
    how to correct the format?
    Message was edited by:
    user588306

    Hello,
    in the formate mask property of the text item write :
    dd-mon-rrrr or dd-mon-yyyy
    regards,
    Abdetu..

  • Custom Date Format in Apex 3.2

    Can I define a custom date format at global level. I am able to select the following date formats only. However, I want to specify a custom date format i.e YYYYMONDD.
    12-JAN-04
    12-JAN-2004
    12-JAN
    04-JAN-12
    2004-01-12
    Monday, 12 January, 2004
    12-JAN-2004 14:30
    12-JAN-2004 14:30:00
    12-JAN-2004 02:30PM
    January
    16 hours ago
    Thanks in advance for the help.
    CM

    Hi,
    You can type to field your custom format.
    Br,Jari

  • How to populate values in Apex item

    Hi,
    I am using apex collection item to capture data my requirement is to calculate data using the apex item
    This requirement is like this. I am using a SQL query like this
    select
    wwv_flow_item.TEXT(1,NULL,20,10) "A",
    wwv_flow_item.TEXT(2,NULL,20,10) "B",
    wwv_flow_item.TEXT(4,NULL,20,10) "C"
    from dual
    There 3 text boxes are generated in the window when i enter 3 in A and 2 in B it must give me a sum value in C as 5
    this has to be done dynamicall as end user key in values this can be done using java script or any other method please suggest
    Thanks
    Sudhir.

    Hello Sudhir,
    >> If there are multiple text box …
    If there are multiple text boxes, you need to allocate each a unique ID. The easiest is to use the substitution string #ROWNUM#. The code should look similar to the following:
    select empno,
    apex_item.TEXT(1,null,20,10,'onchange="addItems(this);"','A'||'#ROWNUM#') "A",
    apex_item.TEXT(2,null,20,10,'onchange="addItems(this);"','B'||'#ROWNUM#') "B",
    apex_item.TEXT(3,null,20,10,'onchange="addItems(this);"','C'||'#ROWNUM#') "C"
    from empBecause we are in a multi-row environment, we need to pass the line number we are on, into the JavaScript function, hence the use of ‘this’.
    In the JavaScript function, we first need to determine the line number we are on, and then use it to perform the calculation. The code can look similar to the following:
    <script type="text/javascript">
    function addItems(pThis) {
      /* extract rownum */
      var line_no = pThis.id.substr(1);
      $x('C'+line_no).value = parseInt($v('A'+line_no)) + parseInt($v('B'+line_no));
    </script>Regards,
    Arie.
    Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.

  • Date Format in Forms 4.5

    For all the date fields in my Oracle Forms application i have set
    a date format of dd/mm/yyyy. When entering data if the user does
    not put the date in the above format, forms raises an error. I
    want to be able to let the user enter the date in any format
    and then convert it to the above format.
    Have you seen any reusable scripts that do this? Has anyone
    done this?
    null

    Hi Mala,
    I wasn't sure as to what you meant by any format. Is it like
    being able to enter a 2 digit year instead of a 4 digit year? Or
    is it like being able to enter the day, month, and year in any
    sequence? Try using the DD/MM/RRRR date format in the item
    properties if the problem is just with the four digit year. This
    allows you to enter a 2 digit year and depending on the value it
    decides whether the 4 digit year begins with 19 or 20.
    Hope this helps.
    CV
    Metro Infomation Services.
    Mala (guest) wrote:
    : For all the date fields in my Oracle Forms application i have
    set
    : a date format of dd/mm/yyyy. When entering data if the user
    does
    : not put the date in the above format, forms raises an error. I
    : want to be able to let the user enter the date in any format
    : and then convert it to the above format.
    : Have you seen any reusable scripts that do this? Has anyone
    : done this?
    null

  • How to display the date from callender for more than one date format items

    i have one form which contains many date format items. i want to show the calendar and take the date from calendar.
    i am successfully show the calendar and take the date from calendar for one date item.
    my problem is i want to do same for all date format items in the form
    can any one help me?
    thanks

    Maybe you could provide more information.
    What calendar ? what item works ? what other don't ?
    is the issue in the different format masks ?
    Please elaborate more your situation.
    Francoisit is not the issue of different format masks.
    i created a block which name is jbeanblock. in this block item is bean. bean has one trigger when_custom_item_event.
    the code of this trigger is :
    DECLARE
    eventName varchar2(30) := :system.custom_item_event;
    eventValues ParamList;
    eventValueType number;
    LC$Date varchar2(256);
    LC$Day varchar2(256);
    LC$Month varchar2(256);
    LC$Year varchar2(256);
    v_date date;
    BEGIN
    IF (eventName='CALENDAR_EVENT') THEN
    eventValues := get_parameter_list(:system.custom_item_event_parameters);
    get_parameter_attr(eventValues,'CALENDAR_EVENT_DATE',eventValueType, LC$Date);
    get_parameter_attr(eventValues,'CALENDAR_EVENT_DAY',eventValueType, LC$Day);
    get_parameter_attr(eventValues,'CALENDAR_EVENT_MONTH',eventValueType, LC$Month);
    get_parameter_attr(eventValues,'CALENDAR_EVENT_YEAR',eventValueType, LC$Year);
    Clear_Message;
    select to_date(LC$Day||'/'||LC$Month||'/'||LC$Year,'dd/mm/yyyy') into v_date from dual;
    :ds_employee.hiredate:=v_date;
    synchronize ;
    END IF;
    END;
    hiredate is the item of the ds_employee table. hiredate has trigger when_new_item_instance. The code is
    Set_Custom_Property('JBEANBLOK.BEAN',1, 'SHOW_CALENDAR','50,50');
    ds_employee is my table name. which has 2 date items. one is hiredate and another is date_of_birth.
    for hiredate it is working. if i want to do same thing for date_of_birth also then how can we do?

  • Date format interfering with interactive report

    My APEX version is 3.1.1.00.09.
    I'm using a method described elsewhere to change the global date format of my application. I have application items for a start and end date. I have two application processes, one for On Load: Before Header, the other for On Submit: After Page Submission - Before Computations and Validations. They both do:
    DBMS_SESSION.SET_NLS(param => 'NLS_DATE_FORMAT', value => '''fmMM/DD/fmYY''')
    Okay, all is well with that, my dates seem to stay the way I want them to. Since our upgrade I'm going through each section of my application and updating as necessary, and I particularly want to use the interactive reports. They work fine when the page is loaded, but if I change any options on the interactive report and submit it, I get an "ORA-01843: not a valid month" error. If I refresh the page, everything works as it should.
    What can I do to get around this, or do I have something wrong with my method that is causing this to happen?
    Chris

    Hi Chris,
    I tried to replicate this, but could not. Now granted, I tried this using the new "modern" method of controlling the default application date format via the new application Globalization attribute "Application Date Format". I set the Application Date Format to fmMM/DD/fmYY and my IR on EMP worked just fine.
    If you can replicate this on apex.oracle.com (using Application Date Format), I'd be happy to take a look at it.
    Joel

  • Different Date Formats in the same "From"

    Hello
    We used different date formats depending on the users language.
    In a report this is simple to implement ... read the date field twice (in different formats dd/mm/yyyy and mm/dd/yyyy) and display only one based on the language.
    I want to be able to do the same in a "form" which updates a date. In this case the about is not allowed.
    Has anyone have solution for this using "APEX" forms or do a need to write a process to achieve this?
    Thanks
    Pete

    Pete,
    You don't specify what version of Application Express you're using, so I'll assume APEX 3.1 or later.
    Are you setting the date format yourself, based upon the user's language?
    1) You could have the application's language derived from Browser, and then APEX would automatically set the NLS_LANGUAGE and NLS_TERRITORY settings accordingly. Then, I would simply use 'DS' as the Application Date Format. For Date Pickers on a form, I would use item type 'Date Picker (use Application Date Format)'.
    2) If you're already determining the date format yourself and you don't want APEX to do it for you, ensure that you are setting this value in an application item (e.g., PETE_DATE_FORMAT). Then, you could still use Application Date Format with a value of &PETE_DATE_FORMAT. (inclusive of the trailing period).
    When you use Application Date Format, the conversion should happen automatically for you so that you don't have to code this yourself on the Form.
    I hope this helps.
    Joel

  • Set Default Date Format in 4.2 jQuery Mobile Smartphone

    Hi guys,
    on "normal" Desktop interfaces you can set a default date format in the Globalization settings. Currently I'm working on a JQM app, and I noticed, that the same settings I have for date format in other apps, don't take affect.
    I now read in the 4.2 release notes, that somehow this issue was a bit buggy. Is this fixed? I would like to set a german date format like "DD.MM.YYYY"; (as it's working in desktop apps). How can I do it? In global settings this entry gets saved.
    But whenever I want to set an individual date-picker-item to that format, it changes back to "YYYY-MM-DD" after saving. And I don't really want to get into writing a conversion function in the dml-processing now.
    Thanks for any hints, best regards,
    tobi

    Hi Tobi,
    the "Date Picker (HTML5)" item type maps to the HTML5 input type="date", which requires that the internal format of the date value always has to be YYYY-MM-DD, but it's up to the browser to actually display the date in the format of the local operating system setting. The browser of iOS for example shows the date in the format of my local language/country setting.
    See also http://stackoverflow.com/questions/7372038/is-there-any-way-to-change-input-type-date-format
    To make a long story short, it's not possible to specify the display format for those date pickers, because it's not supported by the HTML5 spec.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Column in DATE format

    Hello Everybody
    I have a report did Apex, this report has a column which data type is DATE but by default the Apex put it in the format : DD-MM-YYYY HH:MI:SS
    But I only want that his column has the format DD/MM/YYYY
    I know that is posible convert this field using the function TO_CHAR(date, format) but in the report I want to sort this field considering that this filed is in date data type not in char.
    Also I know that I can use the function EXTRACT for concatening the day, month and year and after convert to date in the format 'dd/mm/yyyy'; but I don´t want to write many code.
    I don't want to do some like this:
    TO_DATE(
    EXTRACT( 'DAY' FROM DateFiled )||'/'|| EXTRACT( 'MONTH' FROM DateFiled )||'/'|| EXTRACT( 'YEAR' FROM DateFiled ), 'DD/MM/YYYY' )
    Do you know how to convert to this date format (DD/MM/YYYY) preserving the format?
    I expect your prompt reply.
    Any help will be very appreciated.
    Best Regards

    Hi Eric
    One of the really cool features of the later versions of APEX is the ability to set a default "Application Date Format".
    This is done in the Application xx>Shared Components>Definition then select the "Globalization" tab.
    You can select from a list of pre-defined date formats, or enter your own.
    My preference is "DD-Mon-YYYY" which is not in the list.
    Just leave your date fields as regular DATE type in the select (no formatting in the select).
    This Application Date Format is then used as the default for ALL dates for which you don't specifically set (another) date format
    This is also selecable in the Display options of a "Date Picker (Use Application Date Format)" LOV - for any date page items that you want to provide a date picker.
    This really simplifies the effort in getting a consistent look and feel - and keeping a constant standard throughout the application.
    The other benefit is that you can make a change in one place, and ALL the dates (without a specific date format specification) will change format - just like that.
    This is just one of the features that makes APEX the most productive - and cool - systems around.
    Enjoy!
    Mike

  • Date format dd-mm-yy

    Hi,
    I want to create a date picker item in the following format: dd-mm-yy, but it's not listed among the Date Format options. How can I do that in APEX 4.0?
    Thank you!

    Hi,
    Just type it in the Format Mask text item rather thn using the popup.
    Regards,

  • DHTML Calendar Date Format

    Hello All,
    We recently used solution in thread
    Move Date Picker Pop Up Location
    Guido Zeelen has submitted a terrific example of this on the APEX Studio.
    See http://htmldb.oracle.com/pls/otn/f?p=18326:54:::::P54_ID:2102
    Working example at http://htmldb.oracle.com/pls/otn/f?p=17785:1
    The PL/SQL Function body examples at first link have date formats of d-m-y 21-02-2007
    The second example has %m-%d-%y 02-21-2007
    We tried changing code in PL/SQL Function body below several variations in the ifFormat : "%d-%m-%Y",
    M
    MON
    mmm
    MMM
    m-
    m--
    M--
    Name: DHTML_CALENDAR (DD-MON-YYYY)
    Typr: PL/SQL Function Body
    Shortcut:
    if v('PRINTER_FRIENDLY') = 'YES'
    then
    return ' ';
    end if;
    return '
    <img src="/i/calendar/img.gif" alt="Click here to show a calendar" border=0 width="16" height="16" style="cursor:pointer;" id="#CURRENT_ITEM_ID#_CAL"/>
    <script type="text/javascript">
    Calendar.setup({
    inputField : "#CURRENT_ITEM_NAME#",
    ifFormat : "%d-%m-%Y",
    button : "#CURRENT_ITEM_ID#_CAL",
    singleClick: true,
    align : "cR",
    showOthers : true,
    firstDay : 1,
    electric : false,
    cache : true
    </script>
    Under Home>Application Builder> Application Attributes> Edit Definitions
    Substitutions> PICK_DATE_FORMAT_MASK = DD-MON-YYYY
    on the page item - on the item Source - we have Format Mask = DD-MON-YYYY
    Our goal is to have the following 02-FEB-2007
    Any assistance or comments are greatly appreciated.
    Regards,
    Robert

    Hello Robert,
    I'm glad you like the DHTML calendar solution.
    In order to get the DD-MON-YYYY format, you have to set the following property within Calendar.setup:
    ifFormat : "%d-%b-%Y"
    However, %b returns the abbreviated month capitalized.
    Hopefully this is the answer to your question.
    Kind regards,
    Guido

Maybe you are looking for