7 Replies Latest reply: Apr 6, 2016 1:12 PM by Heidi Korhonen RSS

    Month function in sql query where clause

    Heidi Korhonen

      Hi!

       

      What is wrong in my where clause:

       

      I have a ODBC connection and I'm trying to limit the data by year and month functions in the query.

       

      This is my where limit and the year seems to work but it gives error with the month "invalid tag".

      FROM IFSAPP."GEN_LED_VOUCHER_ROW"
      WHERE YEAR(VOUCHER_DATE)=
      $(vYear) and MONTH(VOUCHER_DATE)=$(vMonth);

       

       

      The variables are

       

      And the form of voucher date in the database is

       

       

      What am I doing wrong?

       

      Regards,

      Heidi