Re: DATE QUESTION

From: STANLEY C. STINES <SCS_at_ornl.gov>
Date: 1995/07/21
Message-ID: <SCS.3.300FE833_at_ornl.gov>#1/1


In article <3ujhfq$2bq_at_homer.alpha.net> sahmad_at_mfa.com (Saad Ahmad) writes:
>Path: stc06.ctd.ornl.gov!fnnews.fnal.gov!usenet.eel.ufl.edu!gatech!howland.reston.ans.net!newsfeed.internetmci.com!news.mathworks.com!news.alpha.net!sahmad
>From: sahmad_at_mfa.com (Saad Ahmad)
>Newsgroups: comp.databases.oracle
>Subject: Re: DATE QUESTION
>Date: 19 Jul 1995 18:04:42 GMT
>Organization: McHugh Freeman
>Lines: 20
>Message-ID: <3ujhfq$2bq_at_homer.alpha.net>
>References: <SCS.1.300D41EA_at_ornl.gov>
>NNTP-Posting-Host: rocko.mfa.com
>X-Newsreader: TIN [version 1.2 PL2]

>STANLEY C. STINES (SCS_at_ornl.gov) wrote:
>> How do I let the user enter in a text field a date format of 122395 (mmddyy)
>> and be able to verify that field is a valid date and display back into the
>> field the format 12/23/95? This sounds simple enough but the TO_CHAR,
>> TO_DATE, FORMAT MODELS and all other things I have tried do not work. I would
>> like to have a simple procedure to do this so that a multitude of forms can
>> Dumb Stan
 

>select to_char(to_date(:your_entry, 'mmddyy'), 'MM/DD/YY')
>into :sql_to_display_var
>from dual;
 

>and trap the exception to mean that entry was invalid.
 

>--
>**************************************************************
>* Saad Ahmad *
>* E-Mail: sahmad_at_mfa.com *
>**************************************************************

Thanks Saad,

The sql works fine except that I have to change the datatype in the forms to a datatype of Char. When I do this then the record will not update on the database since the column is a datatype of date. When I change the datatype back to a DATE type on the form and leave out the Format then the field does not validate because it wants DD-Mon-YYYY. When I put a format of MMDDYY in then the Procedure failes stating the Exception condition that this is an invalid date format. (I had to do a TO_CHAR on the date field so that I could call the procedure and pass the date. Any more help would be appreciated. Thanks in advance.

Stan Received on Fri Jul 21 1995 - 00:00:00 CEST

Original text of this message