Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem with a date in the query !!
First you need April first of current year:
select to_date(to_char(sysdate,'yyyy')||'0401','yyyymmdd') from dual;
Then you need March 31 of next year: (notice the adding of 1 to the year)
select to_date(1+to_char(sysdate,'yyyy')||'0331','yyyymmdd') from dual;
And remember: the correct way to use between is "between <value1> and <value2>" (you used "between.. to...")
Regards Received on Mon Dec 26 2005 - 10:51:28 CST