cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JamtMaster
New Member

Filter within a date range

Hello, I need the gallery to only show me the information within a range of dates that the user will select and then filter what he wants within that date range, if I use both codes separately it filters me by date or by the box of text but if I try to make it filter what the user writes inside the text box in the range that is selected then it does not work, what would be the correct way? I leave the code that I am trying to use:

 

Filter(CarReport;Date>=DTPStart.SelectedDate;Date<=DTPFin.SelectedDate)
&&
SortByColumns(Filter([@CarReport];StartsWith(Lote;txtsearch.Text));"Date";Ascending)

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
timl
Super User
Super User

Hi @JamtMaster 

You can combine the the date and text input in your search like so:

SortByColumns(Filter([@CarReport];
                     StartsWith(Lote;txtsearch.Text) && 
                     Date>=DTPStart.SelectedDate &&
                     Date<=DTPFin.SelectedDate)
               );
              "Date";
               Ascending
)

 

 

View solution in original post

JamtMaster
New Member

That code gave me an error (it says that an argument was placed and I expected more than 1) but looking at the way you organized it I put it in the following way and it worked for me so I mark it as valid, thank you very much.

 

SortByColumns (Filter ([@ CarReport];
StartsWith (Batch; txtsearch.Text);
Date> = DTPStart.SelectedDate;
Date <= DTPFin.SelectedDate); "Date"; Ascending)

View solution in original post

2 REPLIES 2
timl
Super User
Super User

Hi @JamtMaster 

You can combine the the date and text input in your search like so:

SortByColumns(Filter([@CarReport];
                     StartsWith(Lote;txtsearch.Text) && 
                     Date>=DTPStart.SelectedDate &&
                     Date<=DTPFin.SelectedDate)
               );
              "Date";
               Ascending
)

 

 

JamtMaster
New Member

That code gave me an error (it says that an argument was placed and I expected more than 1) but looking at the way you organized it I put it in the following way and it worked for me so I mark it as valid, thank you very much.

 

SortByColumns (Filter ([@ CarReport];
StartsWith (Batch; txtsearch.Text);
Date> = DTPStart.SelectedDate;
Date <= DTPFin.SelectedDate); "Date"; Ascending)

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (5,026)