Aug 03, 2023 07:09 PM - edited Aug 08, 2023 11:21 AM
Our main People table is linked to a Work History table that shows the date and position of each shift worked. I want a field in the People table to show only the most recent date that a person worked. Lookup fields do that, of course, but return all of the shift records for each person. TIA!
UPDATE: The date of the shift worked is stored as text.
Solved! Go to Solution.
Aug 11, 2023 06:28 AM
Can you create new fields? If so, you can create a formula field and use DATETIME_FORMAT() to format that text into a date, and then you can use MAX()
If you can't create new fields then I think you're going to need to use a script for this I'm afraid
Aug 03, 2023 11:17 PM
If you're trying to get the most recent date, try using a rollup field with the formula "MAX(values)" instead? Should do what you want!
Aug 03, 2023 11:23 PM
Hello Jean
I think the best way is that first create a lookup field after that create a new formula field and formula will grab the first value from lookup field
Thanks
Faiz
Aug 04, 2023 07:17 AM
and formula will grab the first value from lookup field - yes, but most recent might be the last value. Or they can be ordered in other way.
I solved similar task in a following way - find last date as @TheTimeSavingCo said, then created lookup of that field back in the second table, add formula like "if(current date = last date,'yes','no')" and created lookup in a first table filtered by "formula='yes'"
Aug 08, 2023 11:19 AM
Adam, the MAX function is not available to me because the shift worked field is text. I can't change that.
Aug 11, 2023 06:28 AM
Can you create new fields? If so, you can create a formula field and use DATETIME_FORMAT() to format that text into a date, and then you can use MAX()
If you can't create new fields then I think you're going to need to use a script for this I'm afraid