Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.
Function code (current version): CREATE OR REPLACE FUNCTION DAYS_IN_Q(DT1 in date, DT2 in date, QE in date) RETURN number AUTHID CURRENT_USER AS DAYS number; QB date := trunc(QE,'Q'); begin if DT1>QE or DT2<QB then DAYS := 0; else DAYS := least(QE,DT2) - greatest(QB,DT1); end if; RETURN DAYS; end; --Select statement: select START_DATE ,END_DATE ,DAYS_IN_Q(START_DATE,END_DATE,to_date('2009-06-30','YYYY-MM-DD')) as "DAYS_IN_Q209" ,DAYS_IN_Q(START_DATE,END_DATE,to_date('2009-09-30','YYYY-MM-DD')) as "DAYS_IN_Q309" --What I want to do is simply my function so when I call it, it looks like: --,DAYS_IN_Q(to_date('2009-09-30','YYYY-MM-DD')) as "DAYS_IN_Q309" --(Obviously I need to write it so it only requires one parameter - That's not my problem.) from MY_TABLE
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.