cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

My Filter Expression for Dates is not working

Shawnaby
New Contributor

Hello All,

I have a date field in input and Iโ€™m trying to apply a filter

I want to filter only for the date type field: ZCC04 Proc. Date
where it is before todayโ€™s date minus 11 days.

Iโ€™ve tried both expressions but nothing is being outputted.

Date.parse($[โ€˜ZCC04 Proc. Dateโ€™]) <= (Date.now().minusDays(11))

$[โ€˜ZCC04 Proc. Dateโ€™]<Date.now().minusDays(11)

Since the recordโ€™s Proc date is June 27, 2022 (2022-06-27), I would think the record would be filtered as true since 11 days before today would be July 11, 2022.

June 27, 2022 < July 11, 2022

Iโ€™m so upset itโ€™s not workingโ€ฆ

4 REPLIES 4

bojanvelevski
Valued Contributor

Hey @Shawnaby,

I believe that this is happening because the date is not parsed at all. Can you show us the format of the incoming date?

Agreed with @bojanvelevskiโ€™s point.
The data type might be different for both the dates for which Date.parse didnโ€™t work for you.

Iโ€™ve tested the same solution and it was working for me, please refer to this for more details:

Yes I had to parse the date. I thought it was already in date format, so I thought I didnโ€™t need to specify the convention after the field ($xxx, yyyy-MM-DD)โ€ฆ

Great, so is it safe to assume that the issue has been resolved?