2 Replies Latest reply on Feb 22, 2016 11:24 AM by keitho

    Find a name using a Variable



      I am looking for a way to find the total spend of clients using their name from my database. The names will change so I can't search for a particular name


      How do I link a Variable to a name then pull out that clients total spend using that variable?


      Bet it's simple when you know how!!

        • 1. Re: Find a name using a Variable

          You should be doing it by unique key values, NOT by name. Each table of your database should have a primary key (unique ID like a serial number or UUID), then tables should be related by foreign keys that reference those primary keys. EG If I had a customers table, with an ID field, I would tie a Sales::customerID field to that primary key to relate Sales and Customers.


          That said, searching by any variable value is easy with a script:

          Set Variable [ $key ; yourTable::valueToSearchField ]

          Enter Find Mode [ no pause ]

          Go To Layout [ layout you are searching on ]

          Set Field [ tableSearching::fieldSearching ; "==" & $key ]

          Perform Find

          • 2. Re: Find a name using a Variable

            Thanks for your advice Mike, I will give it a go