Error when sorting dates in a Enum column type

Good day to all,

I have a form with a date field of ENUM type data comes from a slice. When using ORDERBY to sort the dates ascending, get an INVALID DATE on the form. If only a select is used it works but the dates are not in order. From another post @Aleksi suggested to use TEXT as the base type for the ENUM. When I changed it to text got a long date which then gave error when saving to the DATABASE.

What is need is a list of unique dates sorted in descending order, how can that be acomplished?

Attached screen shots.

This is my current formula:
Screen Shot 2020-06-29 at 1.24.18 PM

@James_McFarlane
How about this:

SORT(
    SELECT(
        entrevistas a trabajar[Fetcha],
        TRUE,
        TRUE,
    ),
    TRUE // set it to FALSE if you want in descending order
)

Thanks @LeventK that did the trick. Wonder why sort did it and not order by, but it worked.

I did end up with a lone ranger… attached screen shot.
Screen Shot 2020-06-29 at 1.48.12 PM

@James_McFarlane
ORDERBY only works if the SELECT expression is returning the key column values. If your list is not key column values, then you shall be using SORT instead. You can read here:


For the lone range, check and ensure that your column in your spreadsheet is also formatted explicitly as Date (not left as automatic) and also 6/24/2020 is purely a date, not a text value.

1 Like

I know and my data resides in MySQL db column is set to date.

Thanks again.