REPOST: Re: [REPOST] The "TO_DATE" Function Question
Date: Tue, 1 Jan 2002 15:29:24 -0500
Message-ID: <9$--$$-$-%$_%_-__$_at_news.noc.cabal.int>
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
- WAS CANCELLED BY =======: Path: news.uni-stuttgart.de!uni-erlangen.de!newspump.monmouth.com!newspeer.monmouth.com!newshub2.home.com!news.home.com!nntp.abs.net!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!sac.uu.net!lax.uu.net!news.navix.net!u.n.a.c.4.n.c.3.l.l.e.r From: "Claire Breton" <cbreton_at_collegeem.qc.ca> Newsgroups: news.admin.censorship,alt.test,comp.databases.oracle.tools Subject: cmsg cancel <b3pY7.25194$ap1.1195988_at_weber.videotron.net> Control: cancel <b3pY7.25194$ap1.1195988_at_weber.videotron.net> Date: Wed, 2 Jan 2002 04:48:07 GMT Organization: Navix Internet Subscribers Lines: 2 Message-ID: <cancel.b3pY7.25194$ap1.1195988_at_weber.videotron.net> NNTP-Posting-Host: 166.102.15.34 X-Trace: iac5.navix.net 1009947998 29203 166.102.15.34 (2 Jan 2002 05:06:38 GMT) X-Complaints-To: abuse_at_navix.net NNTP-Posting-Date: 2 Jan 2002 05:06:38 GMT X-No-Archive: yes Comment: Dude, where's my NewsAgent? Xref: news.uni-stuttgart.de control:40286702
autocancel Received on Tue Jan 01 2002 - 21:29:24 CET
