Issue with now() function

I’m having a fundamental problem using the now () function in quicksight. I’m trying to get data for a previous day. Im trying to count the number of entries on this date for the previous day and it was always equal 0 in thsi function countIf({date},{date}=adddatetime (-1,‘dd’,now())). If I manually enter the actual date in instead of the adddatetime function , it works fine. Why wont it work?

I would trunc the dates.

What I think is happening is that you are checking to see if the date IS EXACTLY now minus a day.

Now minus a day right now would be 12/5/2022 4:38 PM.

Are you wanting to check if it’s just yesterday? If so then utilize the truncDate function on now and or your date as well.

countIf({date},{date}=adddatetime (-1,‘dd’ truncDate(‘DD’, now())))

This worked! Thank you so much!