[REPOST] The "TO_DATE" Function Question
Date: 1 Jan 2002 11:41:10 -0800
Message-ID: <a68a4ee0.0201011141.596efbf2_at_posting.google.com>
[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 /
[Quoted] [Quoted] 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
[Quoted] | 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 - 20:41:10 CET