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.

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.

  • 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...

  • 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

  • I would like to format cells with time only.  when I enter a time of day the current date is still in the cell which is not necessarily so

    I would like to format cells with time only.  when I enter a time of day the current date is still in the cell which is not necessarily so.  THere are  no options for just  date .

    christine275 wrote:
    ... (this is a time worked by date and not always entered on the date worked)--
    "Time" in Numbers is always "Time of Day", and is always part of a Date and Time value. "Amount of Time" is a Duration value, which may be displayed in a similar format to "Time of Day," but is a different type of value.
    If you are entering the number of hours and minutes worked, format the column as Duration, set the units and the format in which you want to have the value appear.
    The Date column will still contain a Date and Time value (Jan 1, 2011 00:00:00 in the cell shown in the example), but the "Time Worked" cells will contain only a Duration value.
    Incidently, the Date in A2 was entered as "jan 1" (without the quotes). Numbers automatically adds the current year and the default time value, then displays the result in the closest format to what you've entered, or in the Date and Time format you have chosen.
    The Duration value in B2 was entered as 3:15 (as displayed). Note that in the entry bar the duration is displayed as 3h 15m, probably to distinguish it from a similarly formatted (Date and) Time value.
    Regards,
    Barry

  • 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.

  • 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

  • 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 Issue with Interactive Form

    Hi, here is the scenario:
    -We just upgraded to SP17 from SP15
    -I'm using Livecycle Designer 8.0
    When we were on SP15, this was not an issue.  I was wondering if anyone encountered this problem and if so, if there is a workaround?
    I create an interactive form to start a guided procedure process.  Im passing the data from my desktop Interactive form to another callable object in GP to send an email with the PDF attached.  This all works correclty. 
    My date/time fields are set to type DATE with a display pattern of YYYY-MM-DD.  When I create the form in the GP administrator to my desktop and open the PDF, the date format is correct. However, when I submit the form to start the process, the incomming date fields to be mapped to my second Callable Object have change in format from "2009-02-18" to  "Wed Feb 18 00:00:00 EST 2009".
    This is true in the new form I receive via email, and also in NWA->monitoring->guided procedures when I check the instances.  The input mapping is already set to the false formatting.
    When I open the form from the second callable object with the incorrect date format (in designer), the date's display patterns are set to YYYY-MM-DD but are not being displayed as such.
    New discovery....I tried to create a Business Logic callable object and format the date.  I created a string input and date output and mapped them accordingly.  When I perform a "TEST" from the design time and use the input "Wed Feb 18 00:00:00 EST 2009", the string is automatically converted to 18/02/2009 in the output, which is what I want to occur.  The only problem is when I run the actual process, the same "Wed Feb 18 00:00:00 EST 2009" is being output instead of the 18/02/2009 in the TEST.
    Anyone have any ideas?
    Thanks.
    Edited by: Warren Clements on Feb 26, 2009 2:20 AM

    This test program might help...
    import java.util.*;
    import java.text.*;
    public class ExpandYear
        public static void main(String[] args) throws ParseException
         SimpleDateFormat sdf_2dyear = new SimpleDateFormat("MM/dd/yy");
         SimpleDateFormat sdf_4dyear = new SimpleDateFormat("MM/dd/yyyy");
         String test1 = "3/21/00";
         System.out.println("test1: " + test1 + " to : " +
                      sdf_4dyear.format(sdf_2dyear.parse(test1)));
         String test2 = "4/9/99";
         System.out.println("test2: " + test2 + " to : " +
                      sdf_4dyear.format(sdf_2dyear.parse(test2)));

  • 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

Maybe you are looking for

  • Unable to synch purchased iTunes videos to iPhone after transfer from PC

    I just purchased a new MacBook and have transferred my iTunes library from my original Windows PC to the Macbook. None of the videos will synch to my iPhone. As a test, I purchased another small movie from iTunes and it still will not synch the new m

  • ITunes producer error ITMS 9000

    I receive this error message but don't know how to decipher it or correct the problem. It seems to refer to a small image that I have long-since deleted. Help? ERROR ITMS-9000: "File : /OPS/assets/images/ClickHandler.ashxruhttp3a2f2fus.123rf.com2f400

  • Authentication Delays / Slow Authentication for Open Directory Users

    I'm experiencing delays when authenticating Open Directory users and it absolutely has me at my wit's end. The problem is quite simple: any time an Open Directory user authenticates his password there is a delay of at least 5-10 seconds. This goes fo

  • Duration for email response

    Hi, Where can I define the duration (days) within which an incoming email should be responded? For example, if I'm receiving an email in my Agent Inbox today so it will show Creation date a today (01/30/09). Where can I define the number of days (ex:

  • My mac keeps slowing down or miscuing when i'm trying to record in garageband

    Any tips on speeding up my macbook when i'm recording, I've disabled my wi-fi and blue tooth and nothing else is running, but still has lag for some reason when i'm recording which is a real pain when i'm trying to record in real time.