I created a custom filter on a date to select records for the max date and the date before. if I use [Date] >= DateTimeAdd([Max_Date],-1,'DAYS') I only get the MAX record. if I reverse the logic to [Max_Date] <= DateTimeAdd([Date],1,'DAYS') I get both days. If I use a formula to create the previous date as a column then the filter [Date] >= [yesterday] works. I've attached the workflow sample.
Solved! Go to Solution.
Hi @SoccerTil if you wrap your datetimeadd() in a todate() function like below, then the filter works as expected.
ToDate(DateTimeAdd([Max_Date],-1,'DAYS'))
The datetimeadd() function, as its name suggests, will default to the datetime data type, and as we can't control the data type in a filter, like in a formula then we need to use the ToDate() function here.
If you convert your [Yesterday] field to a datetime, then you'll see the same issue as before.
Ultimately what's going on is that 2020-01-03 != 2020-01-03 00:00:00
Hope that helps,
Ollie
Thanks for the answer. Good to remember that the result is a date time. I'll share with all my peers.