8 Replies Latest reply: Dec 13, 2016 2:58 PM by Eduardo DImperio RSS

    Problem using IF statement

    Eduardo DImperio

      Hi everyone,

       

      I having extremely dificult using IF statement in QS, for me is very diferente that other languages like C,C# or PHP

       

      Im trying this:

       

      If (OID_METER = Peek(OID_METER),

             If (Floor(DATE_READ)= Floor(Today()),

                   (Peek(VALUE_READ)- VALUE_READ) * TYPE_CONSTANT   as CONSUMODIA0,

                    HORA as HORA0

                 )

              If (Floor(DATE_READ)= Floor(Today()-1),

              (Peek(VALUE_READ)- VALUE_READ) * TYPE_CONSTANT   as CONSUMODIA1,

               HORA as HORA1

                  )

              If (Floor(DATE_READ)= Floor(Today()-2),

              (Peek(VALUE_READ)- VALUE_READ) * TYPE_CONSTANT   as CONSUMODIA2,

               HORA as HORA2

                  )

        )

      The error is ')' expect, but where? i close all "()"