2 Replies Latest reply on Mar 5, 2012 1:19 PM by philmodjunk

    Copy only part of a field

    itsmeisthatu

      Title

      Copy only part of a field

      Post

      is it possible to copy the first 4 digits of a field so they can be pasted into another field before i can then preform a find.

      or would it be better to preform a find for the first 4 digits, in which case how would that be done.

      it is for a postcode field. im trying to group calls based on the postcode but if i copy and paste the whole thing in then the results are limited to just a few houses.

       

      has any body managed this before.

       

      thanks in advance.

       

        • 1. Re: Copy only part of a field
          davidanders

          Scripts can do many things using calculations.  Calculated fields can do the same things.

          Right   Middle   and    Left   will allow you to make a calculation field that is Left (otherfield, 4)  result can be a number or text field

          OtherField        CalculatedLeftField
           1234567890      1234
          ABCDE12345      ABCD


          https://www.google.com/search?q=filemaker+right+middle+left

          Home > Reference > Functions reference > Text functions > Left

          Left
          Purpose 
          Returns numberOfCharacters in text, counting from the left.
          Format   Left(text;numberOfCharacters)
          Parameters
          text - any text expression or text field
          numberOfCharacters - any numeric expression or field containing a number
          Data type returned
          text
          Examples
          Left(“Manufacturing”;4) returns Manu.
          Left(Name;Position(Name;“ “;1;1)) returns Sophie, when the Name field contains Sophie Tang.
          Left(PostalCode;3) & Upper(Left(LastName;4)) returns 481JOHN when the PostalCode field contains 48187 and LastName contains Johnson.
          • 2. Re: Copy only part of a field
            philmodjunk

            copy and paste are script steps best left unused unless you have no other choice. Here's a possible script step that uses the first 4 characters of a postcode field to find all records where the post code starts with the same 4 characters:

            Set variable [$LeftFour ; value: Left ( YourTable::PostCode ; 4 ) ]
            Enter find mode [] //clear the pause check box
            Set field [YourTable::PostCode ; $LeftFour ]
            Perform Find []