Re: 4 digit year problem

From: PC Automation <dullery_NOSPAM_at_us.oracle.com>
Date: 1998/04/13
Message-ID: <01bd6726$5cc2a440$5ab41990_at_dullery-lap>#1/1


My forms 4.5 experience is limited to a class, but I have written a lot of 3.0....

It has been a while since i have written any forms code, BUT This code should get you very close.



X varchar(10);
begin
X := to_char(date_fld,'MM/DD/YYYY'); -- should generate exception if format is wrong
EXCEPTION
when others then

    error('Format is: MM/DD/YYYY''); -- or whatever the "error popup" function is.
/* message("Format is: MM/DD/YYYY")

    raise form_trigger_failure;
end;

  • or you can check LENGTH (should be 10) or use INSTR. There is also an 'RR' --format that you may want to look at. 'RR' format will translate '98' to '1998', but '49' --to '2049'
    Perhaps, 4.5 programmers have a more elloquent solution.

Best Regards,

David S. Ullery

Savithri Devaraj <sdevaraj_at_csc.com> wrote in article <352CE8CA.16377CDD_at_csc.com>...
> We use Developer 2000 forms 4.5 on our project here. Many of our forms
> have a date input in them. We have defined the format for the date as
> MM/DD/YYYY. Inspite of this, the user is allowed to input a 2 digit
> year. Does anyone know how i can force the user to enter a 4 digit year
> always?
> For eg, if the user inputs 98, it is interpretted as 0098.
> Any clues, how i can enforce the user to enter 0098 or 1998?
>
> Thanks a lot for any suggestion
> Savithri
>
>
Received on Mon Apr 13 1998 - 00:00:00 CEST

Original text of this message