2 Replies Latest reply: May 2, 2018 5:30 AM by P Kumar RSS

    Where condition at select statement

    P Kumar

      Hi Experts,

       

      Can any one please help me on below requirement.

      I have a oracle table like below in qlik

       

      Table:

      Load

           DATE,

           ACCOUNT,

          CURRENCY,                                      

          VALUE,                                                 

           GBPVALUE ;                                          

      Sql

          select

            to_char(ap.date,'DD/MM/YYYY') as date,

            ap.account,

            ap.currency,

            ap.value,

            ap.gbpvalue

      from account ap

      where to_char(ap.date,'DD/MM/YYYY') in '31/07/2017';


      In the above table at where condition i have to apply where ap.date <= '31/07/2017' in static way dynamic method is not required.just for testing purpose.

      Please help me how to write that oracle syntax at select statement.



      Thanks in advance.

        • Re: Where condition at select statement
          Sunny Talwar

          Try this

           

          Table:

          Load

               DATE,

               ACCOUNT,

              CURRENCY,                                     

              VALUE,                                                

               GBPVALUE ;                                         

          Sql

              select

                to_char(ap.date,'DD/MM/YYYY') as date,

                ap.account,

                ap.currency,

                ap.value,

                ap.gbpvalue

          from account ap

          where ap.date <= TO_DATE('31/07/2017', 'dd/mm/yyyy');

            • Re: Where condition at select statement
              P Kumar

              Thanks for your reply sunny below one is also working.

              Table:

              Load

                   DATE,

                   ACCOUNT,

                  CURRENCY,                                     

                  VALUE,                                                

                   GBPVALUE ;                                         

              Sql

                  select

                    to_char(ap.date,'DD/MM/YYYY') as date,

                    ap.account,

                    ap.currency,

                    ap.value,

                    ap.gbpvalue

              from account ap

              where to_char(ap.date,'DD/MM/YYYY') <= '31/07/2017';