How can I choose the latest date in a child-object's records for a table in the parent-object?

I followed the instructions from "How do I find the most recent date from a connected object?", but the dates I wind up with (after converting to a number in the child object, then going to the parent object and using Max to find the new one, then converting back from number to date) are WAY off. If I use "hours" as a date format, I get numbers about 50,000 years in the future. If I use "days" as the date format, all the resulting dates are from 1970, when they should be in Spring 2021. 

Hi - I have used that approach in the past - but I have a working example where I just use a formula in the child object like this:

And then use a Max field against this - seems to work as expected.

Hi - I see the reply solution link is unavailable - any can advise on a solution. My formula to convert a number backinto date format simply yields no answer. Remains blank?

Hi @Mark3 - not sure what happened to the image in my old response but let me try to explain what I do…

Basically I use a Max field in the parent object - but if you try to set one us you will find that a regular date field is not one of the child fields that you can “Max”. What I do is to have an equation field which makes a new version of this (still in date format):

You will find that you are then able to use Max to get the latest value of this date in the parent object:

And the result shows as a date:

Screenshot 2022-04-28 at 17.40.44

Now - full disclosure here - this shows as a date but can’t be used as a date in filters etc as is - for that you need to use another Equation just to convert the Max into a value that Knack recognises as a date:

Extremely long winded but doable!

1 Like

Thank you @JulianKirkness Appreciate

Last week I was doing some tutoring with a client and the subject of obtaining the latest date from a connected object came up. :calendar:

I appreciate that many of you will know how to do this, but I thought it would be worthwhile diving in a bit deeper and walk through the process step by step.

Hopefully this will help someone. :technologist:

Mastering Max Dates:
Unix Time in Connected Tables

1 Like