Best choice for a date column in forms

Hello,
I want to know what is the best choice for a date field that the user have to enter manually. I read on a other post that a calender control is not directly implemented in forms 9i. So what is the best choice to be "user friendly" with a date field in a form?
thanks in advance.

Hi
Don't know if this would be much use to you, but I wrote this function 'Check_Date' a while back to check whether the user had typed something which could be interpreted as a date. You'd make your date field into a Text Item, and include a call to this function (which could be in your form, or in a library) in the WHEN-VALIDATE-ITEM trigger on the item, ie:
IF NOT check_date(:ITEMS.date_item1, NULL, NULL) THEN
    RAISE FORM_TRIGGER_FAILURE;
END IF;This would mean that the user could type 'T' or '*' for today, '+1' for tomorrow, '-7' for one week ago, or the date in a variety of formats. When they leave the field, the function tries to resolve what they've typed into a date, and sets the field to a date in the correct format.
('Display_Alert' is just a function to display a named alert with a message.) It can also be used to check that the date entered doesn't fall outside upper and lower bounds. Code follows:
FUNCTION Check_Date (text_in        IN OUT VARCHAR2,
                     lower_bound_in IN DATE,
                     upper_bound_in IN DATE)
RETURN BOOLEAN IS
first_letter      VARCHAR2(1)  := SUBSTR(text_in, 1, 1);
date_ok           BOOLEAN;
this_date         DATE;
date_diff         NUMBER(8);
output_format     VARCHAR2(12) := Get_Application_Property(BUILTIN_DATE_FORMAT);
TYPE date_format_table_type IS TABLE OF VARCHAR2(12)
INDEX BY BINARY_INTEGER;
date_format_table    date_format_table_type;
BEGIN
    --Set up table of date formats in order they'll be tested for
    date_format_table(1)  := 'DD-MON-RRRR';
    date_format_table(2)  := 'DD-MM-RRRR';
    date_format_table(3)  := 'DD-MM';
    date_format_table(4)  := 'DD-MON';
    date_format_table(5)  := 'YYYY-MM-DD';
    date_format_table(6)  := 'YYYY-MON-DD';
    --Use of T, or * for today's date...
    IF UPPER(text_in) IN ('T', '*') THEN
           this_date := SYSDATE;
           date_ok := TRUE;
    --Look for use of +x/-x for number of days different from today
    ELSIF first_letter IN ('+', '-') THEN
           BEGIN
               date_diff := TO_NUMBER(SUBSTR(text_in, 2));
               IF first_letter = '+' THEN
                   this_date := SYSDATE + date_diff;
               ELSE
                      this_date := SYSDATE - date_diff;
               END IF;
               date_ok := TRUE;              
           EXCEPTION
                  WHEN VALUE_ERROR THEN
                      --User has entered something like '+X', so not valid
                      date_ok := FALSE;
           END;
    ELSE
        --Go through all the possible formats for date entry,
        --if any give a valid date, then return that.
        FOR ix IN date_format_table.FIRST..date_format_table.LAST LOOP
               EXIT WHEN date_ok;
            BEGIN
                   --Try creating a date using the format masks in the local
                   --table.  If no good, this will throw an INVALID_DATE exception
                   this_date := TO_DATE(text_in, date_format_table(ix));
                   date_ok := TRUE;
               EXCEPTION
                   WHEN OTHERS THEN
                       date_ok := FALSE;
               END;
        END LOOP;
    END IF;
    IF date_ok THEN         
           --Check for violation of lower/upper bounds on date
           IF (lower_bound_in IS NOT NULL AND this_date < lower_bound_in) THEN
               Display_Alert('info_alert', 'Date cannot be before '||TO_CHAR(lower_bound_in, output_format));
               date_ok := FALSE;
           ELSIF (upper_bound_in IS NOT NULL AND this_date > upper_bound_in) THEN
               Display_Alert('info_alert', 'Date cannot be after '||TO_CHAR(upper_bound_in, output_format));
               date_ok := FALSE;
           ELSE
                  text_in := TO_CHAR(this_date, output_format);
           END IF;
    ELSE
        Display_Alert('INFO_ALERT', text_in||' is not a valid date !!');
    END IF;
    RETURN date_ok;
END;Hope this is useful.
regards
Andrew
UK

Similar Messages

  • Best practice for heirachical data

    First off, I have to say that JMX in Java 6 is terrific stuff. Bundling jconsole in with Java has made JMX adoption so much easier for us.
    Now, to my question. We have read-only hierarchical data (think a DOM tree) that we would like to publish via JMX. What is the best practice? We see two possibilities:
    1. Publish each node of the tree with it's own object name and type. This will allow jconsole to display the information in the tree control.
    2. Publish just the root of the tree with an object name and type and then use CompositeType to describe the nodes of the tree. This means you look at the tree in the "Attribute Value" panel of jconsole.
    Is there any best practices for such data? We have implemented #2 and it works but we are wondering if long term this might lead to unforeseen consequences.
    Thanks in advance.
    --Marty                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Path,
    I did go with #1 and it worked out great. Every node in our tree is an ObjectName node. Works very well for us.
    --Marty                                                                                                                                                                                                                                                                   

  • Best practice for sharing data with model window

    Hi team,
    what would the best practice for sharing data with a modal
    window be ? I use a modal window to display record details from a
    record list, but i am not quite sure how to access the data from
    the components in the main application in the modal window.
    Any hints would be welcome
    Best
    Frank

    Pass a reference to the parent into the modal popup. Then you
    can reference anything in the parent scope.
    I haven't done this i 2.0 yet so I can't give you code. I'll
    post if I do.
    Oh, also, you can reference the parent using parentDocument.
    So in the popup you could do:
    parentDocument.myPublicVariable = "whatever";
    Tracy

  • Best choice for a proxy server on NT?

    Hi, I'm wondering what the best choice for a proxy server is on NT?
              Currently I'm running a 2 WL server cluster, but this will grow rapidly. If
              all of the pages that I will be handling will be .jsp (with the exception of
              1 or 2 servlets), which is the best configuration (performance wise) to go
              with?
              Should I use a Weblogic Servlet, NSAPI, or ISAPI to do the proxiing. My
              guess was that IIS would perform the best on an NT machine and that it would
              not be as large as a memory hog as Weblogic would be to simply run as a
              proxy. Is there a significant amount of latency produced by the ISAPI
              bridge?
              Any suggestions?
              Thanks,
              Chris
              

    Chris,
              Please do not cross post across the newsgroups. We would very much
              appreciate it.
              There is a response to this message posted on the performance newsgroup if
              you're interested.
              Thank you so much!
              Michael Girdley
              BEA Product Manager
              Chris <[email protected]> wrote in message
              news:851ks4$auk$[email protected]..
              > Hi, I'm wondering what the best choice for a proxy server is on NT?
              >
              > Currently I'm running a 2 WL server cluster, but this will grow rapidly.
              If
              > all of the pages that I will be handling will be .jsp (with the exception
              of
              > 1 or 2 servlets), which is the best configuration (performance wise) to go
              > with?
              >
              > Should I use a Weblogic Servlet, NSAPI, or ISAPI to do the proxiing. My
              > guess was that IIS would perform the best on an NT machine and that it
              would
              > not be as large as a memory hog as Weblogic would be to simply run as a
              > proxy. Is there a significant amount of latency produced by the ISAPI
              > bridge?
              >
              > Any suggestions?
              >
              > Thanks,
              > Chris
              >
              >
              

  • Best choice for a bluetooth car kit for the 4S?

    I want to add a car kit to my 2004 MINI I have the Aux in jack for the audio HK ans XM radio system that came with the car but the 2004 Nokia bluetooth kit that was installed when the car was new only worked with a 2004 Nokia feature phone and after I replaced that phone with a motorola phone in06 I have had to use a Jabla ear piece for hands free in the car... and with the new 4S I would like to fit a proper working bluetooth car kit I understand there is something new about how bluetooth is implimented in the 4S that is causing some problems with car kits.
    has a concesis as to what should be bought yet? if not if the smart thing to do to wait a few months?

    Chris,
              Please do not cross post across the newsgroups. We would very much
              appreciate it.
              There is a response to this message posted on the performance newsgroup if
              you're interested.
              Thank you so much!
              Michael Girdley
              BEA Product Manager
              Chris <[email protected]> wrote in message
              news:851ks4$auk$[email protected]..
              > Hi, I'm wondering what the best choice for a proxy server is on NT?
              >
              > Currently I'm running a 2 WL server cluster, but this will grow rapidly.
              If
              > all of the pages that I will be handling will be .jsp (with the exception
              of
              > 1 or 2 servlets), which is the best configuration (performance wise) to go
              > with?
              >
              > Should I use a Weblogic Servlet, NSAPI, or ISAPI to do the proxiing. My
              > guess was that IIS would perform the best on an NT machine and that it
              would
              > not be as large as a memory hog as Weblogic would be to simply run as a
              > proxy. Is there a significant amount of latency produced by the ISAPI
              > bridge?
              >
              > Any suggestions?
              >
              > Thanks,
              > Chris
              >
              >
              

  • HT3819 I want to send my itunes library from my old macbook (start up disk nearly full) to my new iMac then delete my itunes library from my old macbook.  Is Homesharing my best choice for this?

    I want to send my itunes library from my old macbook (start up disk nearly full) to my new iMac.   Then delete my itunes library from my old macbook.  Is Homesharing my best choice for this?
    What I don't want to happen is once I delete my itunes library from my old Macbook that the iMac itunes library to delete itself because I am using Homesharing.  Does homesharing sync and make that happen?

    Here is some help.
    https://discussions.apple.com/thread/3849933
    After confirming that all your stuff is on the drive, delete the photos you have copied. You will need to empty the iPhototrash to free up the space.

  • S260 & the best choice for battery life

    hi,
    with a s260, what's the best choice for the microprocessor for having the best battery life?
    is there tips for increasing the battery life ? (software tuning, adding battery...)
    why the fan run at a low temperature?
    thanks,

    This is what Apple has to say...
    http://www.apple.com/batteries/iphone.html

  • JSF - Tomcat security...what is the best choice for a high activity site

    JSF - Tomcat security...what is the best choice for a high activity site
    The JDBCRealm is not multithreaded so what are options for high activity site??
    I would like to have Apache as front end doing load balancing, Tomcat as server and JSF.
    All ideals and suggestions please.
    Thanks
    Phil

    One more question.
    Since Tomcat has this setup.
    create table users (
    user_name varchar(15) not null primary key,
    user_pass varchar(15) not null
    create table user_roles (
    user_name varchar(15) not null,
    role_name varchar(15) not null,
    primary key (user_name, role_name)
    It seems like a huge pain to keep a user with every role. What happens when you have 500,000 users???
    Also, the authentications on every page....would it be easier to login once and setup a session bean check that on with the page header ??
    Thanks
    Phil

  • What is the best choice for our project? Thanks

    We are a startup company and developing a webiste with two mobile app.
    We use PHP in the server side and write with a private framework.
    We don't want to use any host-specific APIs so that we can move to other cloud server easily.
    In our case, can we use Website option in Azure?
    If the answer is yes. What is the best choice for us, VM or website? We need scalability in the future.
    Thanks!

    hi,
    It depends on your requirement. Base on my experience, VM or website all could meet your requirement. From your description, You could use azure website to host your php website (http://www.windowsazure.com/en-us/documentation/articles/web-sites-php-configure/).
    And you could use website auto scale feature in the future. I suggest you could see their comparison (http://www.windowsazure.com/en-us/documentation/articles/choose-web-site-cloud-service-vm/
    Hope it helps.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • The best choice for the 2nd exam

    Hi friends,
    I'm going to obtain a certification as Oracle PL/SQL Developer Certified Associate and I need to know, for the second exam, what is the best choice for a newbie:
    Program with PL/SQL 1Z0-147
    OR
    Oracle Database 11g: Program with PL/SQL 1Z0-144
    Thank you,
    Ion

    user5310220 wrote:
    Hello All,
    Next week am going for 1z0-144. Is anybody out there who has already cleared this exams and can help me about the kind of questions asked in it (like more practical or conceptual). Also about any special kind of book he studied apart from steven 4th edition.
    Thanks for your help.
    DG.... Well after seeing other replies .... I think you need a bit of encourgement ... so good luck.
    I have not actually taken this even.
    You MAY glean a little from the JG videos .... (but be aware many will ay it tells them nothing) .... [http://blogs.oracle.com/certification/2009/08/0096.html]
    What follows is a little of what you may expect ...
    The questions are obviously multiple choice .... at OCA level most will probably indicate the number of correct answers required (as opposed to select all correct answers ... expect to see more of those at OCP/OCE). A few may be drag and drop or something similarly fancy. Some will offer exhibits to be viewed. However there should be enough time for the reasonably able candidate to complete the exam hilst reading questions carefully if they do not daydream.
    Most production exams have a set of 10 sample questions (IMHO often not of the highest quality and I am inclined to refer to them as the beta (program) rejects .... questions that didnt make it from the beta exam to the production exam .... and I don't really a justification for that). No such luck with 1z0-144 as far as I can se though.
    This is a modern exam; and the questions will probably tend to reflect that. The questions will be most like 1z0-051 questions than 1z0-007 questions.
    Therefore the sample questions from 1z0-051 may give a simple insight into the variation of question types o expect [http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=303&p_certName=SQ1Z0_051]. (Be aware this is a very small ... and possilby skewed ... sample).
    This is probably not what you are looking for .... but is about as far as I can go.
    Anyone who has taken the exam is bound by non-disclosure agreements and there is very little anyone can sensibly say without possilby getting themselves into trouble.
    Rgds - bigdelboy.

  • Digital Video Interfaces??  Is AJA the best choice for the money??

    I am using FCP HD, and have always worked with Mini DV. But we just purchased a Sony PVW-2600 Beta deck, and I believe that I'm needing to purchase some kind of interface.
    Is AJA the only or best choice for me? Can you give me some suggestions?
    Thanks so much!
    Bryce

    It's not the only choice, as Blackmagic/Decklink make good cards too, as do Aurora. But whether it's the best choice is another matter. There's lots of different decisions to make - HD compatibility? Effects acceleration? Monitoring outputs? Rack mountability?
    Others will respond.

  • Captivate..best choice for Quizzes?

    I am wondering if Captivate is the best choice for quiz development. I am used to the creative possibilities with Flash and find the "templated" nature of Captivate limiting and frustrating. I would like some validation from you Captivate users before I spend too much more time trying to get this lame application to work for me. (maybe it's me that is lame but I am frustrated). Do you all think this is a viable application that is worthy of the learning curve and limitations?
    Thank you
    Rich Gilman

    Hi Rich,
    I happen to be a big fan of Captivate. I've been using it since it's RoboDemo days and it keeps getting better. That having been said, if your primary need is to develop quizzes, there are better options out there.  I tend to use Captivate quizzing only when I want to add a few questions as an integrated part of a course. If I wanted to develop a stand alone quiz, I would turn elsewhere. If you have the Flash skills, there's no reason not to use Flash. There are also programs specifically designed for quiz development.
    One person's opinion!
    ERR229

  • Best choice for wireless extender

    The best choice for a wireless extender or repeater is not to use one at all. I consider it to be an absolute last resort tactic. Imagine that I won’t talk to you so I have to tell someone else to, of course you won’t talk to me either so all the communication has to go through someone else, it really slows down trying to have a conversation and that’s how a wireless extender works. It cuts the bandwidth by 75% under ideal conditions, more in real world conditions.

    Spiceheads;I have a need to extend signal from a wireless router in two diffferent scenarios. I asked Google, and he gave me about 471,000 results in 0.46 seconds. Checked some reviews, but I never know which of those are REAL reviews, and which arepaid advertisements. I checked here on Spiceworks, but there is nothing recent that I could find, and these things change quickly. Any suggestions would be appriciated.Scenario 1:This is at my bosses house. He has a commercial grade WiFi router in the garage. I have a Netgear or Linksys USB stick extended from his PC with a USB cable. His signal is pretty low, although the router is pretty near. I suspect there are some thick walls in the house, which is pretty upscale. I can't get to the area where the PC is to run new wire, as it is an addition with no access. I am considering trying a...
    This topic first appeared in the Spiceworks Community

  • MOVED: Best choice for new RAM on nForce SLI Platinum

    This topic has been moved to Overclockers & Modding Corner.
    Best choice for new RAM on nForce SLI Platinum

    Quote from: dmostert on 06-April-05, 17:39:39
    OK,
    So it would then seem that going for the tighter PC3200 RAM is better that going for the more relaxed PC4000 RAM    
    It would also seem that the Corsair is a slightly better buy than the Kingston    In general, which overclocks better Corsair or Kingston?
    Thanks,
    D.
    Kingstone have a reputation for producing faster compatible memory to replace that found in HP, compaq's etc. Corsair do have a reputation for producing memory for overlockers. Note that dosn't mean memory which overlclocks, it means memory which overlockers can use to push the FSB harder and overlock the CPU.
    This is really not a problem for AMD64 users. P4 systems have a poor memory peroformance, and hate running asych. You can push an AMD64 by running the memory asynch without noticing from my expericnace testing my system.
    My current system is running at 305 FSB, 1/180 devisor for 275mhz. Everest benchmarks my latency at 43ns, read speed 7300mb/s, write speed 2800mb/s. 

  • Best practice for phone number column data type

    Hi,
    I hope I have posted this in the right forum, if not just notify me and i will remove it to the correct area.
    What would be considered best practice for storing a phone number.
    Number of Varchar2.
    Ben

    Well I was thinking that Number would have the following disadvantages,
    1. Users entering phone numbers into a form may be tempted to pre format with spaces, thereby throwing up an error.
    2. Mobile phone numbers may have leading zeros
    3. Calculations are not carried out on phone numbers.
    I was leaning towards a varchar2 type.
    Ben

Maybe you are looking for

  • BPM: Send step bypassed at run time

    Hi, In BPM, there is a send step after a transformation step in a block. In the corresponding interface mapping for the transformation step, the name of the .xsl mapping name is incorrect in spelling. Now due to this a strange situation is happening.

  • Null Vaues in the W_DAY_D Table

    Hi , We ran a full load for the W_DAY _D table and found that there are few null values with the row id for Feb 29 , feb 30 etc. Is this a expected behaviour ? We also altered the mapping to filter the null values .... Please provide your expertis on

  • After Effects Composition Not Refreshing in Premiere Pro

    I'm using a late 2013 Macbook pro 15 inch 2.3ghz with Creative Cloud CC, updated as of 27/5/14. I am linking after effects compositions in my premiere pro sequence. After pressing enter to render my effects and watch my project so far, i'll go to cha

  • Flash Player Freezing

    Hi i hope someone out there has had this same issue and has a solution as i am out of ideas the problem i am experiencing is with ie8 and firefox versions of flash player everything has been working great for some time now until the last couple of da

  • Why I cannot print

    Please help me.  I've iMac, Adobe Reader XI, cannot print, only blank pages coming out of printer.  No problems with Words or Excel, can print same pdf file in Preview though.  Help please.