| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL: How to select date by month and/or year
In my database, we store dates as '01-jan-96' a simple selection can be as follows:
select substr(date,1,2) ===> 01 select substr(date,4,3) ===> JAN select substr(date,8,2) ===> 96 select substr(date,4,6) ===> JAN-96
Thanx....
Gianni Rino
In article <5kn4c5$i6u$1_at_news.rwth-aachen.de>,
raab_at_amsd3c.imib.rwth-aachen.de says...
>
>
>Hello,
>
>how can I perform a selection of a date-field by any single subfield
(day, month, year ...). I tried
>
>select * from test_table where date_field like to_date('01', 'MM')
>
>and some other combinations without success (i.e. "0 rows selected").
>
>I checked the FAQs but didn't find helpful information.
>
>Thanks ind advance.
>
>Friedhelm Raab raab_at_amsd3c.imib.rwth-aachen.de
Received on Sat May 10 1997 - 00:00:00 CDT
![]() |
![]() |