2 Replies Latest reply on Apr 8, 2017 12:02 PM by haider2016

    Record Number

    haider2016

      Hi there,

      How to get the record number of a record that contains a field with a  specific value using ExecuteSQL.

      for instance:

      ExecuteSQL("SELECT --- FROM table name WHERE \"filed content\"=something";"";"")

       

      my question is what should I put instead of --- to get the record number ?

       

      Thanks in advance

        • 1. Re: Record Number
          Jason Wood

          The name of the field that contains the record number, or if you need the internal record ID, you need to add a calculation field that is = Get(RecordID)

           

          ... but for most purposes you should not be using the internal record ID

           

          Edit:

           

          Example:

           

          ExecuteSQL("SELECT \"fieldname\" FROM \"tablename\" WHERE \"anotherfieldname\"='value'";"";"")

           

          If it's possible to get multiple values back, you should put a row separator in the 3rd parameter, or if you just want the first result, add "FETCH FIRST 1 ROWS ONLY", for example.

          1 of 1 people found this helpful
          • 2. Re: Record Number
            haider2016

            Dear Jason Wood,

            Thank you for your valuable notes.

             

            Regards,