Re: Newbie question about format masks.

From: <ccyr6798_at_my-deja.com>
Date: Thu, 21 Oct 1999 22:04:42 GMT
Message-ID: <7uo2lo$nmc$1_at_nnrp1.deja.com>


Wim,
I wanted to allow users to enter either 211099 or 21-OCT-1999. I accomplished it by assuming if the str len was 6, it was the former format. I converted it to date, then back to a string. Ultimately, I inserted my string into the db with a to_date as Dave shows.

    IF LENGTH(:SEARCH.BEFORE_DATE) = 6 THEN       :SEARCH.BEFORE_DATE := TO_CHAR(TO_DATE (:SEARCH.BEFORE_DATE, 'DDMMYY'),'DD-MON-YYYY');
    ELSE

      :SEARCH.BEFORE_DATE := TO_CHAR(
                                 TO_DATE (LTRIM(RTRIM
(:SEARCH.BEFORE_DATE)),
                                          'DD-MON-YYYY'),
                                 'DD-MON-YYYY');
    END IF;
    insert TO_DATE(:SEARCH.BEFORE_DATE,'DD-MON-YYYY');

In article <7un191$10f$1_at_toto.tig.com.au>,   "Dave Waterworth" <pscdaw_at_ihug.com.au> wrote:
> INSERT to_date('21101999','ddmmyyyy') INTO table
> SELECT to_char(date_column,'dd/mm/yyyy') FROM table
>
> Is that what you mean?
>
> Wim Valgaeren <valgaeren_at_softhome.net> wrote in message
> news:7umh9f$dqn$1_at_naxos.belnet.be...
> > How can I insert a date as ddmmrrrr and show it as dd/mm/rrrr in
forms 5.0
> ?
> >
> > If you know this, please let me know.
> > Thanks.
> >
> > Wim Valgaeren
> >
> >
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Oct 22 1999 - 00:04:42 CEST

Original text of this message