For ur problem select reqDate from tbl where reqDate between to_date('7/11/2005','mm/dd/yyyy')and to_date('7/11/2005','mm/dd/yyyy')+6
try this out select date_n, rownum from (select distinct (to_date(tab.reqDate)) as date_n from tbl tab order by to_date(tab.reqDate) asc ) where rownum <= 6
select date_n, rownum from (select distinct (to_date(tab.reqDate)) as date_n from tbl tab where to_date(tab.reqDate) > to_date('07/21/2005','DD/MM/YYYY') order by to_date(tab.reqDate) desc) where rownum <= 6
Check this out and let me know if this query works.
select date_n, rownum from (select distinct (to_date(tab.reqDate)) as date_n from tbl tab where to_date(tab.reqDate) <= to_date('21/07/2005','DD/MM/YYYY') order by to_date(tab.reqDate) desc) where rownum <= 6
Please check the way i have given the input, it is not '7/21/2005' but '21/07/2005' as we want 'DD/MM/YYYY' format
Check this out and let me know if this query works.
Sorry i messed up a bit again, i gave you the query for previous dates Here is the final one i hope
select date_n, rownum from (select distinct (to_date(tab.reqDate)) as date_n from tbl tab where to_date(tab.reqDate) >= to_date('21/07/2005','DD/MM/YYYY') order by to_date(tab.reqDate) desc) where rownum <= 6
Hi Meera My core expertise is Java, J2EE and i am learning SQL. So if u have any problem with SQL let me know. I would surely give a try as it would be a live project for me . Good to know that it worked fine. Enjoy
Regards Makarand Parab
Post by:autobot
No thanks. We have all the government we need. This tiny ad would like you to leave now:
a bit of art, as a gift, the permaculture playing cards