Re: [REPOST] The "TO_DATE" Function Question

From: Claire Breton <cbreton_at_collegeem.qc.ca>
Date: Tue, 1 Jan 2002 15:29:24 -0500
Message-ID: <b3pY7.25194$ap1.1195988_at_weber.videotron.net>


HI!

Correct the clause where for

 WHERE registration_date = '22-JAN-1999';

and you will obtain the result.

If you don't type 1999, I think that will be considered like2099.

CB

"aleatory" <aleatory_at_hotmail.com> a écrit dans le message news: a68a4ee0.0201011141.596efbf2_at_posting.google.com...
> Hi all,
>
> I have a question on the "TO_DATE" function.
>
> I'm learning Oracle SQL using SQL Plus. The following
> is from the book "Oracle SQL Interactive Workbook."
>
> | SQL> SELECT last_name, registration_date,
> | 2 TO_CHAR ( registration_date, 'MM/DD/YYYY' )
> | 3 FROM student
> | 4 WHERE registration_date = '22-JAN-99'
> | 5 /
>
> After executing this, the program displays:
>
> | no rows selected
>
> When I execute the following code, the information
> is there. With the previous SQL code, no rows get
> displayed:
>
> | SQL> SELECT registration_date
> | 1 FROM student
> | 2 /
> |
> | REGISTRAT
> | ---------
> | 22-JAN-99
> | 22-JAN-99
> | 23-JAN-99
> | etc...
>
> The column "registration_date" has the following
> structure:
>
> | SQL> DESC student
> | 1 /
> |
> | Name Null? Type
> | ----------------- -------- ------
> | registration_date NOT NULL DATE
> | etc...
>
> I also tried the following code, but the result was the same:
>
> | SELECT registration_date
> | FROM student
> | WHERE registration_date = TO_DATE ( '22-JAN-99' )
>
> I would appreciate any help on this issue.
>
> Thanks in advance!
>
> alea
Received on Tue Jan 01 2002 - 21:29:24 CET

Original text of this message