Figure out the least date from the list

Hi Everyone,

Thanks in advance,

I have list which is having list of dates {1/1/2026; 2/2/2026; 12/31/2025; 11/24/2025}.I needs to identify the least date and Maximum date from the list.

Regards

Divya K

  Discussion posts and replies are publicly visible

  • 0
    Certified Associate Developer

    This will help you:- 

    a!localVariables(
    /* Your list of dates */
    local!dateList: {
    date(2026, 1, 1),
    date(2026, 2, 2),
    date(2025, 12, 31),
    date(2025, 11, 24)
    },

    /* Find minimum (earliest) date */
    local!minDate: min(local!dateList),

    /* Find maximum (latest) date */
    local!maxDate: max(local!dateList),

    /* Display results */
    {
    minDateFormatted: text(local!minDate, "YYYY/MM/DD"),
    maxDateFormatted: text(local!maxDate, "YYYY/MM/DD")
    }
    )