![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I don't see this in the TO_DATE documentation, and because it's January I can't see how to test this to confirm. select to_date('2009','YYYY') from dual; => shows 01-JAN-2009 The day is defaulting to 1, but what of the month? - is the unspecified month defaulting to 1 (i.e. January) - or is the unspecified month defaulting to the current month (which just happens to be January because of when I ran the test). Thanks for any feedback. |
#3
| |||
| |||
|
|
Malcolm Dew-Jones schrieb: I don't see this in the TO_DATE documentation, and because it's January I can't see how to test this to confirm. select to_date('2009','YYYY') from dual; => shows 01-JAN-2009 The day is defaulting to 1, but what of the month? - is the unspecified month defaulting to 1 (i.e. January) - or is the unspecified month defaulting to the current month (which just happens to be January because of when I ran the test). Thanks for any feedback. From http://download.oracle.com/docs/cd/B....htm#sthref795 DATE Datatype You use the DATE datatype to store fixed-length datetimes, which include the time of day in seconds since midnight. The date portion defaults to the first day of the current month; the time portion defaults to midnight. The date function SYSDATE returns the current date and time. So, if you query the same in february, you'll get 01-FEB-2009 |
#4
| |||
| |||
|
|
I don't see this in the TO_DATE documentation, and because it's January I can't see how to test this to confirm. select to_date('2009','YYYY') from dual; => shows 01-JAN-2009 The day is defaulting to 1, but what of the month? - is the unspecified month defaulting to 1 (i.e. January) - or is the unspecified month defaulting to the current month (which just happens to be January because of when I ran the test). Thanks for any feedback. |
#5
| |||
| |||
|
|
"Malcolm Dew-Jones" <yf... (AT) vtn1 (DOT) victoria.tc.ca> a écrit dans le messagede news: 4967e20... (AT) news (DOT) victoria.tc.ca... |I don't see this in the TO_DATE documentation, and because it's January I | can't see how to test this to confirm. | | select to_date('2009','YYYY') from dual; | => shows 01-JAN-2009 | | The day is defaulting to 1, but what of the month? | | - is the unspecified month defaulting to 1 (i.e. January) | | - or is the unspecified month defaulting to the current month (which just | happens to be January because of when I ran the test). | | | Thanks for any feedback. | SQL> select to_date('2009','YYYY') from dual; TO_DATE('2009','YYY ------------------- 01/03/2009 00:00:00 1 row selected. Regards Michel |
![]() |
| Thread Tools | |
| Display Modes | |
| |