Date
422368Sep 16 2006 — edited Sep 16 2006Hello,
I have the following query which returns dates till this month from January 2005.
I need to have one condition where current month should display only when dates becomes 25th else results should display only till last month.
:Eg: Right now it is Jan-2005 till Sep 2006. What I wanted is if date is less than 25 then display till Aug 2006 else display till Sep 2006.
How can I acheive this?
** SQL**
select distinct to_char(period_name,'Mon-YYYY') period_name from dt
where period_name >= to_date('01/01/2005','DD/MM/YYYY') and period_name <= trunc(sysdate)
--and period_name
order by to_date(period_name,'MON-YY') desc