Forum Discussion

DanielJohnson2's avatar
DanielJohnson2
Qrew Trainee
3 years ago

Formula Syntax Error Question

Hi All,

Here's the formula I thought would work:

todate(max(getfieldvalues(getrecords("{756.EX. '"&[Record ID#]&"'}", "abdc3n4ne"),1)))

The logic is, find all records where fid 756 (related field) in table abdc3n4ne equals the record ID in the table where this formula is, then of those records tell me the values in the Date Created field, then just tell me the most recent of those dates (what I thought the max formula would do) then turn it into just the date.

I'm getting a syntax error. The second ) after the 1 at the end is highlighted yellow and the error box says "Expecting," but that's for the max function, which I didn't think needed a comma.

Thoughts?

------------------------------
Daniel Johnson
------------------------------

7 Replies

  • There is not currently a way to process the returned records to get the max value.  Maybe in the future, but Formula Queries do not support Max at this time.

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • DanielJohnson2's avatar
      DanielJohnson2
      Qrew Trainee
      Rats!

      So, my next thought was to change the formula field type to text and then use another field to parse out the data I want. The formula was:

      totext(getfieldvalues(getrecords("{756.EX. '"&[Record ID#]&"'}", "abdc3n4ne"),1))

      But when I clicked save I got the following error:

      Uh-Oh! The way this formula is built will take too long to process. Please try refining your formula.

      Not sure what to do with that.

      ------------------------------
      Daniel Johnson
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        How large is your table, how many records?

        ------------------------------
        Mark Shnier (YQC)
        mark.shnier@gmail.com
        ------------------------------
  • PaulPeterson1's avatar
    PaulPeterson1
    Qrew Assistant Captain
    I ran into a similar issue.  Fortunately I already had a relationship between the two tables and the table where I needed the data was the parent table of the relationship.  I created a max summary field in the relationship that returned the value I needed and used "Only summarize records where the following are true to handle the conditions of the query.

    ------------------------------
    Paul Peterson
    ------------------------------