3 Replies Latest reply: Nov 1, 2010 7:55 PM by Pablo Labbe RSS

    How to query the expression statistics data


      Hey guys,

      I'm Chinese,English so poorly,I hope someone can know my question

      The form have a input box (we can input two nums),and have a btn,we can use btn search the data from chart,and data is expression statistics .the expression is

      if(rzxxcs <> '' and rzsxcs <> '',
      if(Count (??ID) >= rzxxcs and count(??ID)<= rzsxcs,count(??ID)),
      if(rzxxcs = '' and rzsxcs <> '',
      if(count(??ID)<= rzsxcs,count(??ID)),
      if(rzsxcs = '' and rzxxcs <> '',
      if(Count (??ID) >= rzxxcs ,count(??ID)),

      How do it use vb script actions?

      My plan:

      1.define fourvariables : NUM_SX,NUM_XX,rzxxcs,rzsxcs

      2.define the variables NUM_SX,NUM_XX to Input boxs

      3.vb script action

      ' Create By KanGwei in 2010/10/26

      ' get the value of variable

      function getVarValue(p_varname)
      end function

      ' set the value to variable

      sub setVarValue(p_varname,p_varvalue)
      dim d_var
      Set d_var=ActiveDocument.Variables(p_varname)
      d_var.setContent p_varvalue,true
      end sub

      ' Search action

      sub s_dosearch

      dim d_sx,d_xx

      d_sx = getVarValue("NUM_SX")
      d_xx = getVarValue("NUM_XX")

      ' ???? ?? ???? Error info
      if d_sx < d_xx then
      msgbox "????????????"
      ' All Passed?Do Search
      elseif d_sx >= d_xx then
      call setVarValue("rzxxcs" ,d_xx)
      call setVarValue("rzsxcs" ,d_sx)
      end if

      end sub


      Now ,I have two problems:

      1.Do you have another method do it?(I hope you can give me a QVW)

      2.After search,How to clear the variable in the expression ?


      My Msn:willking6517@live.cn