REPOST: [REPOST] The "TO_DATE" Function Question

From: aleatory <aleatory_at_hotmail.com>
Date: 1 Jan 2002 11:41:10 -0800
Message-ID: <1$--$$-$-%$_%%__$$_at_news.noc.cabal.int>



[Quoted] Hi all,

[Quoted] 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!dns.phoenix-ag.de!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!skynet.be!skynet.be!newscon05.news.prodigy.com!prodigy.com!abq.news.ans.net!uunet!chi.uu.net!lax.uu.net!news.navix.net!u.n.a.c.4.n.c.3.l.l.e.r From: aleatory_at_hotmail.com (aleatory) Newsgroups: news.admin.censorship,alt.test,comp.databases.oracle.tools Subject: cmsg cancel <a68a4ee0.0201011141.596efbf2_at_posting.google.com> Control: cancel <a68a4ee0.0201011141.596efbf2_at_posting.google.com> Date: Wed, 2 Jan 2002 04:40:25 GMT Organization: Navix Internet Subscribers Lines: 2 Message-ID: <cancel.a68a4ee0.0201011141.596efbf2_at_posting.google.com> NNTP-Posting-Host: 166.102.15.34 X-Trace: iac5.navix.net 1009948004 29203 166.102.15.34 (2 Jan 2002 05:06:44 GMT) X-Complaints-To: abuse_at_navix.net NNTP-Posting-Date: 2 Jan 2002 05:06:44 GMT X-No-Archive: yes Comment: Dude, where's my NewsAgent? Xref: news.uni-stuttgart.de control:40286720

autocancel Received on Tue Jan 01 2002 - 20:41:10 CET

Original text of this message