BC4J Date format mask

After specifying a date format for an attribute of an entity object using Entity Object Editor - Control hints on the attributes.
Format type: Simple Date
Format: dd/MM/yyyy
When inputting the date manually rather than using the date picker, if only 2 digits are supplied for the year i.e 01/01/02 the resulting date is 01/01/0002, is there any way to force this so the user has to input 4 digits for the year?
Thanks

In a form you can set the format mask item property
whatever you want.
Usually we try to use DD-MON-YYYY without enclosing it single quotes. but you can try
' . . ' or simplly . .
and see what happens.
Suresh

Similar Messages

  • Problem with date format mask 'D'

    I am experiencing an extremely thorny problem with the date format mask ‘D’. I am trying to use it to check whether today is a Monday. The variable v_temp_day is set to sysdate. For the last 4 weeks the code has behaved erratically – giving a different result at 02:00 than at 10:30 even though it is only taking account of the date. In desperation I inserted a debug statement formatting the date in a variety of ways – with interesting results. Oracle is somehow managing to tell us that today is simultaneously Monday and Tuesday depending on which format mask you choose. Anyone got any thoughts or suggestions?
    PROC_ID TO_CHAR(STAMP_TIM
    EVENT_SQLERRM
    RRHKP010 17092007 02:00:00
    TO_NUMBER( TO_CHAR( v_temp_day, D ) ) = 2. TO_CHAR( v_temp_day, D ) = 2. TO_CHAR( v_temp_day, DY ) = MON. TO_CHAR( v_temp_day, DAY )
    = MONDAY . TO_CHAR( v_temp_day, Day DD-MON-YYYY HH24MISS ) = Monday 17-SEP-2007 020000. TO_CHAR( v_temp_day, D ) = 2.
    SQL> select to_char( sysdate, 'D' ) from dual ;
    T
    1

    My book says the trunc(d,'iw') will return "same day of the week as Jan 1st of that year"It's bad book.
    Please read about [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96540/functions176a.htm#80159]TRUNC & 'IW' Format Model and [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96529/ch3.htm#50331]Database Globalization Support Guide: First Calendar Week of the Year in the manual.

  • Error in SQL Date Format Mask

    Hi,
    I am facing problem in validation data in FDQM.
    When I am trying to validate data,I am getting an error as ' An Error occured.Please verify that SQL Date Format Mask is correct'
    The current Date Format in our application is YYYYMMDD.
    I did not have this problem earlier in validating data.This problem is occuring now only and also this error is coming for few entities only.
    Could any one suggest me on how this can be resolved.
    Thanks

    Hi Kelly,
    I checked periods in control tables and there are no duplicates.
    The Period Date Format Mask is MMM-YYYY where as the SQL Date Format Mask is YYYYMMDD.
    These settings are there since the time I created application.Has it got anything to do with database.
    Appreciate your quick response
    Regards,
    Mrudula

  • Convert Oracle date format masks to Java format masks

    Have an application based on Oracle that stores data in text form (for display) and in native date format. It is being migrated to another application with a Java based front end that can only use Java format masks to display the dates in the desired display format.
    Is there a way to translate the Oracle format masks to Java? I can do this in SQL or PL/SQL using the database or in Java.
    I really don't want to write detailed code to parse the masks, although if parsers are available to take an oracle mask into its metadata (minute, year, etc), it may be possible for me to write the code.
    This seems like something that must have been done many times over the years. I would prefer to reuse workable code rather than reinventing the wheel.
    To be clear, I do not need to alter data or convert dates shown in string form. Just the format masks so the new app will display dates in the same manner as the old app. Fortunately, both apps handle interpreting the format masks in their native technology, so it is just converting the format mask.

    kenmadsen wrote:
    Both applications have a varchar2 column and a date column. A date picker selects and returns the date in native format for storage and the application uses the mask to format the varchar2 column for display (and storage). The old application uses an Oracle date format mask DD-Mon-YYYY HH24:MI and the new application uses Java date masks (DD-MM-YYYY hh:mm). (I may not have the translation from HH24 to hh correct).
    The date column and the display column store the same information (a date), but one is stored natively and the other is displayed as the application administrator want the particular row to be formatted for display. (the mask is a column in the same table as the other 2 columns). Each row has characteristics (other columns) that determines what the data is and how it should be shown (some things need to show time; others only the date)
    So the problem is, when migrating, the new application cannot render the dates as the old app did because "Mon" is Oracle format, not Java format.
    No data is being converted in the migration, except for the mask itself. Both applications have the same record structure with respect to these columns and they both use the mask to generate the formatted varchar2 data for display in the application and storage.too bad you insist on try to describe with words rather than actual CODE.
    Please explain again why this is an Oracle problem & NOT a Java problem?
    Oracle RDBMS is a data repository & can't automagically change data content for you.

  • Problem With Date Format Mask

    Hi everyone,
    when i set the date format mask in any field..
    if i enter any wrong date format messages are coming in to loop
    is this is bug of format mask?
    how can i avoid this..
    thanks in advance
    anand mohan

    It should not take you into a loop. If the "validation" against the format mask fails, a message is displayed, and the focus is returned to the field which caused the problem. Do you maybe have some method or event associated with the field which could be causing the circular behavior?
    -- Brian

  • Need help with date format mask

    Hi there, right now I'm trying to set a default date format mask constraint for one of the attributes for my table. I want to set the default mask constraint as MM/DD/YY but I don't know how to. it should be something like:
    CREATE TABLE work (WorkDate DATE CHECK (WorkDate = 'MM/DD/YY'))
    or something like that, but I don't think that's correct. Can anyone help me? Thanks in advance.

    What you want (and should have done) is to read the documentation, starting with the concepts:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#CNCPT413
    http://www.oracle.com/pls/db102/search?remark=quick_search&word=date&tab_id=&format=ranked
    A date is stored as, well, a date, format masks only come into play when you're selecting/retrieving a date or when you want to store a string as a date. Default date formats can be set through NLS_DATE_FORMAT at session and database level.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams122.htm#REFRN10119
    Documentation homes (from which you can do a simple quick search):
    http://www.oracle.com/pls/db102/homepage
    http://www.oracle.com/pls/db112/homepage
    Bottom line:
    Trying to set a default date format mask on a date datatype column makes no sense...

  • DelimitedData and Date Format Mask

    I am using desformat=DelimitedData to generate a Report with Version6.
    Although the date Format Mask is DD-MON-RRRR the date in the report is 11-NOV-34. What can I do?
    Thanks in advance
    Yvonne

    Hi Pieter,
    This does looks like a Bug. Please contact Oracle Support to assist you in getting the right patch or otherwise.
    Regards
    Oracle Reports Team.

  • Help: Date Format Mask Issue year 0004 instead of 2004

    Hi,
    I set Date Format Mask as MM/DD/YYYY for a date field. However, when user enter
    12/31/04 the result turned out as 12/31/0004
    Of course, I'd like user put 12/31/2004, but 12/31/04 leads to 12/31/0004 has to be stopped.
    Any suggestions?
    Thank you in advance.
    Jimmy

    Thank you very much Francois and it works for me.
    Jimmy

  • Date format mask in Enter-Query mode

    Hi,
    I'm developing a Form which is able to query the masterblock from a detail-item.
    The queryable detail-item is a date field and has a datatype: DATETIME. When a new record is entered the values in the date field are stored in the database like "18-10-2002 15:04:02"
    When the form is in enter_query mode the user must be able to enter 18-10-2002 (DD-MM-YYYY format mask, so without time mask). When execute the query with this date format the query is not able to find data.
    I used a Key-Execute-Query on the detailblock like this:
    SELECT 1.COLUMN
    , 2.COLUMN
    INTO :1.COLUMN
    , :2.COLUMN
    FROM TABLE.1
    , TABLE.2
    WHERE 1.COLUMN = 2.COLUMN
    AND TO_CHAR(1.COLUMN,'dd-mm-yyyy') = to_date(:avg.datum,'dd-mm-yyyy');
    Can anyone please help me?
    Regards,
    Ronny.

    Hi Ronny,
    I'm not sure to have got exactly your issue (especially why you have to use that select in master-detail query), but I suggest you to substitute
    ...AND TO_CHAR(1.COLUMN,'dd-mm-yyyy') = to_date(:avg.datum,'dd-mm-yyyy');
    with
    ...TRUNC(1.COLUMN) = TO_DATE(:avg.datum,'dd-mm-yyyy');
    To be fair, I would use it in the where clause, even if you set it dinamically.
    Let us know,
    Marco

  • Date format Mask in Source Value Expression

    Hi there ,
    I am in situation where I will have to have a Formate Mask in the "Source" for the Page ITEM.
    Last refresh date for tables:  &P76_DATA_LOAD. I have the source as refered above. I want that &P76_DATA_LOAD. to have mm/dd/yyyy format mask . How do I do it ? ANy help will be highly appreciated.

    Hi,
    only a string that holds a data will have format masks.
    The way your date column shows up in your database is set up using nls_date_format parameter,
    If you want a string you can just use TO_CHAR(P76_DATA_LOAD,'mm/dd/yyyy')
    If you want your date column to be displayed as above then change the nls_date_format parameter.
    G.

  • Date format mask in report

    I'm having difficulty using a format mask on a DATE field in a report. The format mask is 'HH24:MI:SS'; however, when the date field is displayed in the report it shows up as '00:00:00'. I know that the DATE field in the database is correct because it displays correctly when I do an SQL query. Any suggestions?

    Ken,
    Try TO_CHAR(Date_Field, 'HH24:MI:SS') with alias in you report based on SQL Query.

  • Date Format Mask On Unbound Item

    Hello everyone!
    I have a module with some unbound items. One of them is date_completed. I gave the item datatype DATE and formatmask "DD-MM-RRRR". But in the application, when I type 290108, I get FRM-50026 "date must be entered like : DD-MM-YYYY.
    But I gave the item a format mask!
    Can somebody help me?

    But I gave the item a format mask!Then enter it in the format mask and not as a number
    It is doing exactly what you are telling it to do
    Nicolette

  • Date format mask failure stops navigation

    I'm trying to allow users to enter dates in multiple formats.
    My date items already have format mask 'YYYY-MM-DD'.
    I have added ON-ERROR code that handles errors like FRM-50003 so that users can enter '29-APR-2011' and the error handler fills the date item with '2011-04-29'.
    However, when users enter '29-APR-2011', then tab out of the item, the format mask error stops navigation to the next item. The user needs to tab a second time to actually leave the item.
    There are no FORM_TRIGGER_FAILURE exceptions in my code that would stop navigation to the next item.
    How can I allow users to enter data in formats other than the one I've specified for my format mask, but not have to tab twice to exit the item?
    I know that I can add a KEY-NEXT-ITEM trigger like the following. Unfortunately, I would have to re-write much existing code.
    enter;
    next-item;
    I know that I could remove the format mask and let WHEN-VALIDATE-ITEM handle things. But then I have to add validation code to all my date items. I really just want to write one piece of code that is called from ON-ERROR so that I don't have to re-write all existing code.
    Suggestions?
    Thanks,
    -Ken
    Edited by: Ken Anderson on May 27, 2011 3:12 PM

    With FORMS_USER_DATE_FORMAT you can specify different allowed input masks without having code in your form. Heres some more info Re: Date field in 10g Form

  • Date Format Mask with text only...

    Hi!
    I have a problem with my date text item: the format mask is set to YYYY-MM-DD HH24:MI:SS and it work perfectly if the user enter only numeric character, it will validate the date correctly. But if the user enter a value only alpha (something like 'uuuuyyyy') instead of validate with the mask format it will fire an error trigger ORA-06502.
    I want to know if it's possible to check if the user has enter only alpha to bypass this problem.
    Also, how can a check that a date field is null. I Try with : IF :BLOCK_NAME.DATE_ITEM IS NULL THEN ...
    AND ALSO with IF TO_CHAR(:BLOCK_NAME.DATE_ITEM) IS NULL THEN... and nothings seems to work.
    Thanx in advance.

    AFAIK, the only way to do this is to have two items. One is a hidden database item, type DATETIME, to hold the date value.
    The other is a non-database character item, visible to the user. You populate it at POST-QUERY from the database field, and use an ON-VALIDATE-ITEM to copy any value entered/changed by the user over to the hidden field. If you're smart, you'll write a library procedure to do the on-validate stuff, passing it the names of the two items.
    In that procedure, you can attempt to convert the entered text into a valid date using whatever date format(s) you like, only raising an error if you can't do it at all.

  • Date Format Mask dropping "0"

    I have a field in my report where the source is the "Current Date", and the format mask is as follows:
    fmDay, Month DD, RRRR - HH:MI AM
    So, for example, it should look like this:
    Monday, April 3, 2006 - 5:08 P.M.
    However, it's coming out like this:
    Monday, April 3, 2006 - 5:8 P.M.
    When less than 10 minutes have elapsed from the top of an hour, it's not displaying the "0" between the colon and the last number, evidenced by the fact that what should be 5:08 in the above example, is displaying as 5:8.
    Is there something wrong w/ the format mask I'm using? Any ideas how to correct this?

    Saumen,
    I believe your method probably would have worked, and I'd have used it if I hadn't [accidentally] discovered another way. The format mask I was using before was one of the Reports defaults, and had the "fM" at the beginning. By simply removing this, the field no longer dropped the "0". I still don't understand, but it works.
    Thanks

Maybe you are looking for