1 Reply Latest reply: Dec 14, 2012 6:54 AM by Udo RSS

    Create a custom query select whith item Select List

    979956
      Hello, I'm new to Apex development and I have a problem, I need this query within the year field can be introduced from a list item or something as I can


      SELECT COUNT(*) AS "TOTAL",EXTRACT(month FROM HORAASISTENCIA) EY
      FROM ASISTENCIA
      WHERE HORAASISTENCIA BETWEEN TO_DATE('20110701', 'YYYYMMDD') AND TO_DATE('20110831', 'YYYYMMDD')
      GROUP BY EXTRACT(month FROM HORAASISTENCIA)
      ORDER BY TOTAL desc;


      , so I tried, but nothing where :P1_X is a Select List


      declare
      q varchar2(4000);
      begin
      q:=' SELECT COUNT(*) AS "TOTAL", ';
      q:=q||' EXTRACT(year FROM HORAASISTENCIA) EY ';
      q:=q||' FROM ASISTENCIA ';
      q:=q||' WHERE HORAASISTENCIA ';
      q:=q||' BETWEEN :P1_XFECHA1';
      q:=q||' AND :P1_XFECHA2';
      q:=q||' GROUP BY EXTRACT(year FROM HORAASISTENCIA) ';
      q:=q||' ORDER BY TOTAL desc ';
      return q;
      end;





      Thanks a greeting.
        • 1. Re: Create a custom query select whith item Select List
          Udo
          Hello, and welcome to the OTN forums,

          your question concerns Oracle Application Express (APEX), which ships with XE, but is also used in all other editions of Oracle Database. Since there is a forum for APEX and this one is dedicated to questions specific to XE, I'd recommend you to post again in {forum:id=137}.

          Thanks,

          Udo