Do a search for: Date within a State Range

I’m creating an accounting section of my app that has a dropdown to select options (Last 30 days, This month, This quarter, etc.). The selection then sets a state that contains the selected date range. I then need to search the database for transaction dates that fall within that range. I can’t seem to get bubble to search Date that falls within the Custom State Date Range.

NOTE: The Date Range is kept in the Custom State

So what error does Bubble issue checker show you?

So I managed this so far, but I don’t know if it’s correct. admin_dashboard’s Accounting Period is the Custom State that contains the date range that I need.

Date is a single date of a transaction. I want to filter to include only dates within the Custom State Date Range.

So I’m trying to display a Sum of Transactions who’s Date falls within a Dynamically selected Date Range

As you can check in bubble’s manual - :start → Returns the start of the range, the smallest value.

Screenshot 2023-02-24 at 8.16.08 AM

Why doesn’t this work?

Because you are trying to match field of “date” type (Date) with a date range. So you need a specific date on the right, not a range.

So if you check issue checker there will be something like this:
Screenshot 2023-02-24 at 21.50.20

Bubble tells you that is in operator requires a list of dates. But you are trying to provide a date range. Date range is not a list of dates but just a time in between of two dates:

This represents a span of time from the moment of the first date to the moment of the second date.

So for your requirements you can use following constraints:
date >= your_date_range:start
date <= your_date_range:end

1 Like

That’s actually what I figured out. Thx

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