2 Replies Latest reply: Nov 5, 2013 9:38 AM by Dave Riley RSS

    Dynamic Update Sintax

      I use a Dynamic Update for updating data :

      This string works  : UPDATE MovimentiFinanziari SET PrendiNonPrendi = 'S'   WHERE DataMovimentoTXT = 'D2013091';

      This string NOT works : UPDATE MovimentiFinanziari SET PrendiNonPrendi = 'S'   WHERE DataMovimentoTXT > 'D2013091';

      The difference is the comparison operand of WHERE clause.

      It seems that the operator '='  is OK but the operator '>' is not supported

      Can anyone help me? ?

        • Re: Dynamic Update Sintax
          Gysbert Wassenaar

          I doubt it's the > operator. You're trying to compare string values. Possibly > is a not supported operator for strings in dynamic updates.

          • Re: Dynamic Update Sintax
            Dave Riley

            It's strange but the > and < operators work in my version, QV11.2 SR3.

             

            I suppose another way might be to reference variables in your dynamic command to only use the = operator, maybe something like ...

             

             

            UPDATE MovimentiFinanziari SET PrendiNonPrendi = 'S' WHERE SubStringCount(vVar,DataMovimentoTXT)=1;

             

            ... and vVar is a distinct, and ordered ascendingly, concatenated list of values split at the relevant point ...

             

             

            =subfield(concat(distinct DataMovimentoTXT,';',DataMovimentoTXT),vGT,-1)

             

            ... and vGT is a variable holding the 'greater than' value.