web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter and Lookup not ...
Power Apps
Answered

Filter and Lookup not working with date values

(0) ShareShare
ReportReport
Posted on by 10

Hello all,

 

I have an app whit a date picker. I use that value to try to filter a data source (comming from an Azure SQL database).

I use the following formula on a gallery:

Filter('[dbo].[Inspection]', Date=dpDate.SelectedDate)

and this on a label:

LookUp('[dbo].[Inspection]', Date=dpDate.SelectedDate, InspectionID)

I get not records on the first formula and nothing on the second formula. If I filter for another fields, I get records.

If I change the first formula to:

Filter('[dbo].[Inspection]', Date<>dpDate.SelectedDate)

I get all records.

 

Any ideas? What is the date value passed to SQL?

Categories:
I have the same question (0)
  • Verified answer
    v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @patriciocarpio,

     

    What is the data type for the date field under SQL Server table?

    Currently Date type from SQL Server can't work with PowerApps (a known issue), if possible, please switch to DateTime type.

    Besides, by using the equal sign, the workable around here is:

     

    Filter('[dbo].[Inspection]', DateValue(text(Date))=dpDate.SelectedDate)

    Here we use DateValue( Text() ) together to format the DateTime Type from SQL Server to make it in the same format as DatePicker in PowerApps.

     

    Doing this would make the formula in delegation limitation, which then could only work with the first 500 records.

    See the article below for delegation:

    Delegation

     

    Regards,

    Michael

  • tbendall Profile Picture
    4 on at

    Hi Michael,

    Following on from this issue, is the same fix intended to apply to performing the same function as a LookUp?

     

    i.e.

    LookUp('[dbo].[Inspection]',DateValue(Text(Date))=dpDate.SelectedDate,InspectionID)

    If so, will it work if the field in the SQL server table is smalldatetime?

     

    I have tried the following but to no avail

    LookUp('[dbo].[tRoster]',DateValue(Text(srRosterDate))=DatePicker1.SelectedDate,srID)
  • MasterB Profile Picture
    58 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard