cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Piter_D
Post Patron
Post Patron

How to search and filter items by date

Hi, i have six textsearchboxes, and in last i want search and filter records by date. 

How can i search items in TextSearchBox6 by date. This is my code:

Edit:

I create two data pickers DataPicker1 and DataPicker2 and write code but, it dosen't work

 

 

Filter(
   Shortages,
   (
      IsBlank(TextSearchBox1.Text) ||
      TextSearchBox1.Text in crd55_item
   ) &&
   (
      IsBlank(TextSearchBox2.Text) ||
      TextSearchBox2.Text in crd55_mco
   ) &&
   (
      IsBlank(TextSearchBox3.Text) ||
      TextSearchBox3.Text in crd55_productionline
   ) &&
   (
      IsBlank(TextSearchBox4.Text) ||
      TextSearchBox4.Text in crd55_typeno
   ) &&
   (
      IsBlank(TextSearchBox5.Text) ||
      TextSearchBox5.Text in crd55_vendor
   ) &&
   (
      (ShortageDate >= DatePicker1.SelectedDate 
       Or IsBlank(DatePicker1.SelectedDate)
      )
      And
     (ShortageDate <  DateAdd(DatePicker2.SelectedDate, 1, Days) 
      Or IsBlank(DatePicker2.SelectedDate)
     )
   ) &&
   (
      IsBlank(TextSearchBox7.Text) ||
      TextSearchBox7.Text in crd55_comments
   ) &&
   (
      IsBlank(ComboBox1.Selected.Value) ||
      Status = ComboBox1.Selected.Value
   )
)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Piter_D
Post Patron
Post Patron

I found solution, I just had a bug in Shortage Date, in my case it should be written like 'Shortage Date'

View solution in original post

16 REPLIES 16
JR-BejeweledOne
Super User
Super User

Is shortage date a date field or is it text?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

@JR-BejeweledOne is date field

JR-BejeweledOne
Super User
Super User

Date only or date/time?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

@JR-BejeweledOne date only

JR-BejeweledOne
Super User
Super User

If you take the Date filter piece out, does the rest of the filter work correctly?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Yes

JR-BejeweledOne
Super User
Super User

When I am working with an issue like this, what I do is to just work with the problem piece.   Then when I have fixed that, I put it back together.   So my suggestion to you is to save your filter text in a notepad temporarily and only filter on the date.   Work with the date filter until you get it working.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

I tried to debug the code this way, but unfortunately it didn't work. My date is entered via date only but displayed in the gallery via label, where the value of label is ThisItem.'Shortage Date' . Maybe this has some effect?

JR-BejeweledOne
Super User
Super User

Is the gallery showing the data source directly or is it a collection from the data source?

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,644)