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

Filter on Date Picker not working

I'm connecting to a table from a SQL Server database.  It has a few fields, with one of them being a date (WorkedDate, date datatype).

 

I'm loading that data into a gallery to display it, so I attempted a filter:

Filter(
'[AUDIT].[FBCountSheet]',
WorkedDate = DatePicker1.SelectedDate
)

 

This does not seem to work at all.  My best guess was that it was returning a datetime from the date picker, so I tried doing a DATE(YEAR(),MONTH(),DAY()) wrapper on the Selected Date value to no avail. I have tested the filter on other columns (location, which is an int), but date is the only one that's not working.

 

Bonus question- is there really no way to type in your date on the date picker?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@dungar 

If the date exists in the SQL database but you are not finding any matches it is likely because the date formats difference between SQL and PowerApps.  For example lets say your dates have the following formats.

 

SQL: yyyy-mm-dd hh:mm:ss
PowerApps: m/d/yyyy

 

The solution would be to format the PowerApps date similar to the SQL format.  By the way, many times a date within SQL is stored as plain-text

 

Filter(
    '[AUDIT].[FBCountSheet]',
    WorkedDate = Text(DatePicker1.SelectedDate, "yyyy-mm-dd hh:mm:ss")
)

 

Note: you might have to take a peek at the database tables in SQL to confirm the actual format.

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

1 REPLY 1
Super User III
Super User III

@dungar 

If the date exists in the SQL database but you are not finding any matches it is likely because the date formats difference between SQL and PowerApps.  For example lets say your dates have the following formats.

 

SQL: yyyy-mm-dd hh:mm:ss
PowerApps: m/d/yyyy

 

The solution would be to format the PowerApps date similar to the SQL format.  By the way, many times a date within SQL is stored as plain-text

 

Filter(
    '[AUDIT].[FBCountSheet]',
    WorkedDate = Text(DatePicker1.SelectedDate, "yyyy-mm-dd hh:mm:ss")
)

 

Note: you might have to take a peek at the database tables in SQL to confirm the actual format.

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (8,187)