cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Spreck76
Helper I
Helper I

Trying to filter or lookup on a date field

Okay, been trying a few different solutions I've found on the boards but nothing seems to work. My app is pulling data from an Azure SQL database with a "date" data type. I have entered data using a DatePicker in PowerApps. I am trying to do a simple filter of said data based on a date chosen from a DatePicker. Essentially it is the same DatePicker used to enter the data I want to use to retrieve stored data. I have the Date time zone of the DatePicker set to Local.

 

When I use a simple label with the code DatePicker1.SelectedDate I see the correct date. When I use a filter on a Gallery for example using the formula:

 

Filter('[dbo].[GSP_DailyPrices]', Load_Date = DatePicker1.SelectedDate)

 

I get a blank gallery, no errors, no warnings. Not sure what I'm doing wrong here.

 

Appreciate the help.

 

Thanks,

12 REPLIES 12

Changing both dates to text with specifying format can solve the issue.

 

Text(DataCardValue7.SelectedDate,"[$-en-US]mm-dd-yyyy")=Text(attendance_date,"[$-en-US]mm-dd-yyyy") 

 

DataCardValue 7 --> for attendance_date--> SQL

Thank you johnsonjohn! this worked great. 

 

Text(DataCardValue7.SelectedDate,"[$-en-US]mm-dd-yyyy")=Text(attendance_date,"[$-en-US]mm-dd-yyyy") 

Thanks - not too performant, bit it works for now

 

It's staggering that the product team cannot do a simple data comparison or allow casting to a date. ALL the befits of rapid development get completely wiped out by wasting hours trying to figure out junk like this

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,527)