3 Replies Latest reply: May 14, 2012 6:49 AM by a_j_r___ RSS

    Correct syntax for "between" or ''in''(as in sql) within expression?

    Scott Hay

      Hi All

       

      I am trying to use the GetselectedCount function within an 'IF' expression. What I need is for the expression to do is to sum up a value if the GetSelectedCount is either 1,2 or 3. I know this would be a simple 'is in' or 'between' in SQL, but am not sure of the QV syntax.

       

      I have tried

       

      IF  (GetSelectedCount([MY FIELD)])   = {1,2,3} , 'output')

       

      but it returns no results.

       

      To explain further using the SIMPLE syntax from a text box below how would I need to amend my syntax if I wanted to return a single line/word if 1,2 or 3 fields were selected from  'MY FIELD?

       

       

      =IF (GetSelectedCount([MY FIELD)])   = 0 , 'None Selected', 
       IF (GetSelectedCount([MY FIELD)])   = 1 , 'One Selected', 
       IF (GetSelectedCount([MY FIELD)])   = 2 , 'Two Selected',
       IF (GetSelectedCount([MY FIELD)])  >= 3 , 'Three or more Selected',
        'Error'))))
      
      


      Many thanks and happy FRIDAY!

      Scott