Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Select query using to_date
Hi,
I'm trying to run a select query with a date parameter. The 'Tran_date' needs to be between two dates and I have a 'case' condition that determines these dates:
and a.tran_date between
Case when (extract(month from sysdate)) > 10
then to_date('01/10' || to_number(sysdate, 'YYYY'), 'DD/MM/YYYY') else to_date('01/10' || to_number(sysdate, 'YYYY'-1), 'DD/MM/YYYY')End
If the sysdate month is greater that 10 then the date is '01/10' and the Year needs to be the current year. Else the date is '01/10' and the year is the previous year. I keep getting an 'Invalid number' error.
Can anyone help with this?
Thanks in advance
George
Received on Thu Aug 12 2004 - 06:16:40 CDT
![]() |
![]() |