Friday, January 22, 2021

Conditionally Fiscal year in oracle PL/SQL Function

 create or replace FUNCTION       get_fin_yr ( p_date date ) return varchar2

is 

v varchar2(100);

begin

null;

if to_char(p_date,'mm') between 7 and 12 then 

v:= to_char( p_date,'rrrr') ||'-'|| substr(  to_number( to_char( p_date,'rrrr'))  +1,-2) ;

else 

v:= ( to_number( to_char( p_date,'rrrr')) -1 )||   '-'|| substr(  to_number( to_char( p_date,'rrrr'))  ,-2) ;

end if;

return v;

end;

No comments:

Post a Comment

How to install and configure Oracle Apex 24.1 with ORDS 22, Tomcat 9 and Jasper Report 7 on Oracle Linux 8.10

#########################Install Oracle  APEX 24.1################################ ----------------------------------------------------...