Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5854 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted (edited)

Hi all

I am having a problem having the max function work with a sql table in filemaker.

I have the Sql table in filemaker and i created an extra field in filemaker named it Constant and has always Value 1, i created a new table with 2 fields , Constant , MaxID. I create a relationship to the two tables through constant and created the calculation Max ( ID ) in the MaxID field, but this never return me the maximum id number from the sql field.

Sql Table___________________Filemaker Table

Constant(FM Field)_---------_Constant

ID__________________________MaxID (Max Function)

If anyone got any solution

thank you

Edited by Guest
Posted

I don't have experience with SQL, but if this were two FM tables, you just relate them thru Constant=Constant or using a cartesian (x) join. Now table1 sees all the recs in table2.

The calc in table1 is: max(table1::table2:numfield).

  • Newbies
Posted

Thank you for the reply

I have already done a relation through constant but the problem is the ID is a serial number that is created in both sql and filemaker, when a new ID is created on the sql the Max Value in filemaker doesn't refresh.

I have also noticed that when there are many sql records filemaker does a lot of time to do the refresh.

I am thinking maybe creating the Max value on the sql side i hope maybe that way it works.

Posted

The goal is to get the maximum ID in the SQL table? Why? Are you aware that if a relationship is sorted by ID desc, the first related record would contain the maxID, given an auto-enter serial. Or, use the Last() function on a non-sorted relationship.

What are you doing with the MaxID once you have it?

This topic is 5854 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.