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 Apps
Answered

Date filter

(0) ShareShare
ReportReport
Posted on by 10

Hi guys , 
I have a doubt in filter a date. I have gallery in PowerApps that gallery contain sql table. I need a record to display in that gallery (based on a collector ID) and that record should be less than today date and also hide that null records (sql table date columns contain null records).

less than today date (<today )  and blank .. 
 
My code ; 
Filter(
AddColumns(
MYSQLtable,
"dateoffset",
Text(
DateAdd(
MYDatecolumn,
TimeZoneOffset(),
Minutes
),
"[$-en-US]mm/dd/yyyy"
)
),
DateValue(dateoffset) <= DateAdd(
Today(),
TimeZoneOffset(),
Minutes
) && DateValue(dateoffset),
COLLECTORID = Text(AgeingCollectordd_1.Selected.C901_CODE_ID)
),


thank you all , 

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

    Hi @Sumeth_002 ,

     

    What's wrong with your current code? Is there any error showing on the code?

     

    In general, from the Microsoft official Document SQL Server Connector Reference , we can know that the Direct date filters do not work for SQL Server. However, you can create a calculated column that will work. For instance, ALTER TABLE myTable ADD DateAsInt AS (YEAR([date]) * 10000 + MONTH([date]) * 100 + DAY([date])) and then filter on the calculated number column.

    The following blogs can help you figure this out. 

    https://rajsekhar311.com/2019/06/03/date-filters-do-not-work-for-sql-server-in-powerapps/ 

    https://medium.com/@dmitrii.korolev1/filtering-sql-table-by-date-in-powerapps-4711dc79696a 

    Hope this helps.

    Sik

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard