cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TMelton
Frequent Visitor

Filtering a Gallery by 2 date pickers.

Hello everyone. I am still a little newer to powerapps, but I have a question that has been bothering me for about a week. 

 

I have a gallery (from sql) that has dates in it, I have two date pickers that I need to filter the gallery, like a "start" and "end" date. Capture.PNG

 

Please excuse the lack of formating, but it would be great to get these filters working

1 ACCEPTED SOLUTION

Accepted Solutions
Lancepr
Frequent Visitor

Re: Filtering a Gallery by 2 date pickers.

This is how I got it to work

DP_Start is my first date picker

DP_End is my second date picker

 

Filter('[dbo].[tbl_tablename]',DateValue(Text(Date)) >= DateValue(Text(DP_Start.SelectedDate)) && DateValue(Text(Date)) <= DateValue(Text(DP_End.SelectedDate)))

 

I had to convert my dates using datevalue, even tho the SQL data type was date

View solution in original post

4 REPLIES 4
Community Support
Community Support

Re: Filtering a Gallery by 2 date pickers.

Hi @TMelton,

 

Do you want to filter out records that are within a specific date range?

Please check if the following function will work for you:

Filter([dbo].[Table2],Start>DatePicker3.SelectedDate,End<DatePicker4.SelectedDate)

Please feel free post back if you need more help.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TMelton
Frequent Visitor

Re: Filtering a Gallery by 2 date pickers.

Thanks for getting back to me @v-yamao-msft

 

For this, I put the Column I want to be greater then datepicker where you have "start", or is "start" a function in it self?

 

Edit - So it looks like this is trying to work, but because I have a timezone offset, it is breaking. I am also getting another error, that says "Error on the server" 

 

The time Zone Error says "Expected a valid date value as the parameter to 'TimeZoneOffset' function, recieved value: null"  This function works without the Filter statement

TimeZone Error.PNG

Lancepr
Frequent Visitor

Re: Filtering a Gallery by 2 date pickers.

This is how I got it to work

DP_Start is my first date picker

DP_End is my second date picker

 

Filter('[dbo].[tbl_tablename]',DateValue(Text(Date)) >= DateValue(Text(DP_Start.SelectedDate)) && DateValue(Text(Date)) <= DateValue(Text(DP_End.SelectedDate)))

 

I had to convert my dates using datevalue, even tho the SQL data type was date

View solution in original post

AndiRodi Advocate II
Advocate II

Re: Filtering a Gallery by 2 date pickers.

you will have problems with delegation in this way.

 

Need a workaround.

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,626)