cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mousman85
Helper III
Helper III

Filter by Two dates not working as expected

Hi,

I'm trying to filter a dataverse table, into a collection by checking what items are booked out between two dates. 

I'm using the below code to do the check:

 

ClearCollect(colStockAvailable, Filter('Ordered Items', LoadDate >= varLoadingDate And ReturnDate <= varReturningDate));

 

The isse i'm having is that this isnt' showing any items between those dates, you can see a basic test page below. the gallery on the left should be showing the collection, and the gallery on the right is showing all the items that are in the current table that i want to filter. I'd be expceting to see two items in the filtered gallery, as the load date of those items is 05/09/2021 and the return date is the 29/09/2021. and i'm trying to book out items between 13/09/2021 and 30/09/2021 because my dates are within those dates i need to see what items are already out. But it only works if my dates are earlier than the the items load date in the list. Am i doing this wrong? 

image.png

2 REPLIES 2
Drrickryp
Super User
Super User

@mousman85 

How are you instantiating your varLoadingDate and varReturningDate?

the variables get set on a different screen as part of a onselect button, the dates at the top of that image of the test app are what the variables are set to. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,646)