DATETIME_FORMAT()
isn’t working because it requires a single datetime item, but ARRAYUNIQUE()
still returns an array.
The only functions I know of that will actually output a datetime item are MAX()
and MIN()
, which return the latest and earliest date from an array, respectively. Provided that ARRAYUNIQUE()
leaves you with a single-item datetime array, then this should work:
MAX(ARRAYUNIQUE(values))
That will leave you with an actual date, which can be used elsewhere as needed.