4 Replies Latest reply on Sep 20, 2016 10:59 AM by David Moyer

    Find Length of Field Contents

    StanW

      Hi all,

       

      I would like to find the records where a field's contents are below a defined length. For example, I would like to find all of the records where the length of the field "PersonalPIN" is less than 8. How can I configure a find request to do that?

       

      Thank you

        • 1. Re: Find Length of Field Contents
          philmodjunk

          You can't and thus have to use other means.

           

          One method is to add a calculation field with the expression Length ( YourFieldHere ).

           

          You can then specify find criteria in this field.

          • 2. Re: Find Length of Field Contents
            dtcgnet

            With the # operator, you can find things of a particular length. Phil's method would be good because you could use "<8" as your search criteria in that field.

             

            You could also script a find something like:

            Enter Find Mode

            Set Field [ PersonalPIN ; "@" ]

            New Record/Request

            Set Field [ PersonalPIN ; "@@" ]

            New Record/Request

            Set Field [ PersonalPIN ; "@@@" ]

            New Record/Request

            Set Field [ PersonalPIN ; "@@@@" ]

            New Record/Request

            Set Field [ PersonalPIN ; "@@@@@" ]

            New Record/Request

            Set Field [ PersonalPIN ; "@@@@@@" ]

            New Record/Request

            Set Field [ PersonalPIN ; "@@@@@@@" ]

            Perform Find

             

            That would find records with 1, 2, 3, 4, 5, 6, or 7 characters.

             

             

            Or you could use:

            Enter Find Mode

            Set Field [ PersonalPIN ; "@@@@@@@@" ]

            Omit Record

            Perform Find

             

            That would omit all records whose length was exactly 8 characters.

             

            I'd probably go with Phil's suggestion because of its ease of use and versatility.

            • 3. Re: Find Length of Field Contents
              philmodjunk

              I like dtcgnet's solution as it avoids the need to define a field just for this special purpose.

              • 4. Re: Find Length of Field Contents
                David Moyer

                Good'n - that wasn't in my periphery.

                I suppose that if the PIN's could be longer than eight characters, the omit method would be:

                omit @@@@@@@@*

                * being "all unknown characters".  Also # is the wildcard for numerical digits in the text.

                Unlikely, but if your PINs are strictly numbers, you could use GetAsNumber(pin)<100000000.