4 Replies Latest reply on May 11, 2011 6:00 PM by JingXia

    two global variables in find criteria - not working

    JingXia

      Title

      two global variables in find criteria - not working

      Post

      I can get a find to work for [ ≥ $$lower_bound] and [≥$$upper_bound] and even [1...$$upper_bound] but not [$$lower_bound...$$upper_bound]  - is there a reason for this? Can I remedie this in any way other than to perform my find and then constrain it? 

      Thanks!

        • 1. Re: two global variables in find criteria - not working
          LaRetta_1

          Searching for ≥$$lower_bound in a manual find works because searching for ≥ 'any number' works in text fields.  But searching for ranges in text fields does not work.  If you field you are searching is number and numbers exist in your global variables then $$lower_bound...$$upper_bound would work if you use script as:  $$lower_bound & "..." & $$upper_bound

          Can you verify whether the field being searched is text or number and are you manually searching (which it appears you are) or trying to write a script?

          • 2. Re: two global variables in find criteria - not working
            JingXia

            oops sorry I accidentally clicked the "choose answer" button rather than "reply" 

            I am writing a script actually, my field that I am searching is a number.

            When I set the variabe the window has some text saying "calculations must return text result" my global variable however is set via a numerical feild. So I am not entirely sure whether it is a number or text

            • 3. Re: two global variables in find criteria - not working
              LaRetta_1

              It is okay for a global variable to hold numbers and sometimes you can get into issues with type casting but not in this instance.  The field that matters is the data type of the field being searched.  So if your global variables are:

              $$lower_bound is set with 2
              $$upper_bound is set with 21

              ... and you are searching a number field then use:

              Enter Find Mode [ uncheck pause ]
              Set Field [ thatNumberfield ; $$lower_bound & "..." & $$upper_bound ]
              Set Error Capture [ On ]
              Perform Find[]
              If [ Get ( LastError ) // errors found ]
              Show Custom Dialog [ "No records found"]
              Else
              ... do whatever you wish with your found set
              End If

              • 4. Re: two global variables in find criteria - not working
                JingXia

                brilliant, thanks, i think I was running into troubles mostely because I was putting my criteria into Perform Find [$$lower...$$upper] where you have limited use of scripts and operations. Thanks for your time and patience ^^