Indian Finance Year

create or replace function fin_year(date1 date) return varchar2 as
fin_yr varchar2(200) :=null;
begin
  if (to_char(date1,'MM')<=3)
   then fin_yr :=' APR '||to_char(to_char(date1,'YYYY')-1)||' - '||' MAR '||to_char(to_char(date1,'YYYY'));
  else
        fin_yr := ' APR '||to_char(to_char(date1,'YYYY'))||' - '||' MAR '||to_char(to_char(date1,'YYYY')+1);
    end if;
  return(fin_yr);
end fin_year;
/

select fin_year(sysdate) from dual;

Comments

Popular posts from this blog

FND_GLOBAL.APPS_INITIALIZE for initializing session in Oracle Apps R12