Re: Converting 2 digit Year to 4 digit in Forms 4.5

From: Martin Bronstein <martin.bronstein_at_trw.com>
Date: Thu, 24 Sep 1998 13:58:51 -0700
Message-ID: <360AB28B.3AAF964F_at_trw.com>


I had a similar problem, except 00 was interpreted as 1900 instead of 2000. I solved it by using RRRR instead of YYYY in the format mask. This should insert the correct century in your date.

HTH
Martin Bronstein

michael ringbo wrote:

> Hi All
>
> I run my Forms with the format mask DD.MM.YYYY. But I want the users to
> input the year with two-digits. In that situation Forms automatically
> expands the year to four digits. If the input year is 98 it's expanded
> to 0098. I catch this situation, when the cursor leaves the field, in a
> WHEN-VALIDATE-ITEM trigger and re-expand the input to 1998 or 20XX by
> calling af procedure that based upon a 30/70 year rule finds out if it's
> the 20. or the 21. century. Works just fine.
>
> The problem arises when the user gives the the input '00'. This
> situation is caught by Forms before I get to the WHEN-VALIDATE-ITEM
> trigger. The user is given the error: FRM-40209: Field must be of form
> DD.MM.YYYY'. Alternatively if I just use the standard date format of my
> database (whish is the same), the user gets the error: FRM-50003: Year
> must be 00-99 or 1000-4712. This on seems to be totally non-sense since
> 00 is between 00 and 99, and the year 0872 (for example) is accepted.
>
> I can catch the input-error in the ON-ERROR trigger, and call my
> re-expanding procedure from there. But then I still have the problem
> that the cursor doesn't move out of the field. Probably because a raised
> form_trigger_failure.
>
> Can I get around some way? (I DON'T wan't to skip the date type and use
> a varchar2 instead)
>
> --
> to reply, remove the "-nospam" from the address
Received on Thu Sep 24 1998 - 22:58:51 CEST

Original text of this message