Get count of row on page load filtered by 2 dates

Hi, I’ve bee trying to display the count of a database according to date created on page load. I have a Date/Time Picker Start and Date/Time Picker End where it gets the date and the initial content is current date/time. was able to get all of the list when I change both date/time picker. But when I try to refresh or load the page the count goes back to 0.

This is what I did.

Am doing something wrong?

Are you saying the current date/time is the initial value for both date/time pickers?

yes it is.

Well, seeing as it’s impossible for anything to be created in the future, using a constraint of Created Date ≥ Current date/time will never return any results.

and the other constraint of Created Date < Current date time + 1 day also makes no sense (as I said, nothing can be created in the future, so that constraint isn’t doing anything at all.

I see. So what’s the right constraint?

Well that depends on what you’re trying to search for?..

Like the count for today’s order only, when the page loads.

In that case you just need a single search constraint:

Created date ≥ Current date/time: rounded down to Day

note: that will define the start of today in whichever time zone you specify in the :rounded down to day operation - so just bear that in mind (‘Today’ for one user might be ‘Yesterday’ for another User). Depending on the specifics of your app, that may or may not be something you need to consider.

1 Like

So your saying that the created date will depend on the location of the user?

No, I’m not…

The Created Date is a fixed moment in time - it’s the same for everyone, everywhere, irrespective of time zones.

But, whether that moment in time occurred Today or Yesterday, will depend on the User’s time zone (or whatever time zone you specify).

Oh I see. thank you so much by the way. That worked for me.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.