cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jbrit2020
Continued Contributor
Continued Contributor

Filter gallery to show only results created today

Hi all,

 

I'm kind of struggling with filtering a gallery by date.

 

I'm using a SQL database where the dates are stored in datetime2(7) format.

 

I need to look at displaying only today's dates on the gallery, and for that the only way I found is by doing:

Filter('OP.ORMSRMUpdates', Meeting= SelectedMeeting.Subject,IsToday(Dateupdate))

It works, but it throws a delegation warning.

 

How can I do this in a different way so that I get rid of the delegation warning?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

To eliminate the delegation warning on sql, I sugest you create another column for the Date as per documentation:

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

 

Then use the calculated column for all filtering with sql dates

Documentation:

SQL Server - Connectors | Microsoft Docs

------------

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

 

View solution in original post

5 REPLIES 5
eka24
Super User
Super User

Can you clarify what SelectedMeeting.Subject is referring to. Is it a Datepicker or a Column Name. Also DateUpdate

------------

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

jbrit2020
Continued Contributor
Continued Contributor

SelectedMeeting.Subject is a variable selection from another gallery and DateUpdate is the date of each record in the gallery I want to filter

Ramole
Super User
Super User

Hi @jbrit2020 

Try this 

 

Filter( 'OP.ORMSRMUpdates', 'Date due' = Today() )    

 

No delegation warning

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.
eka24
Super User
Super User

To eliminate the delegation warning on sql, I sugest you create another column for the Date as per documentation:

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

 

Then use the calculated column for all filtering with sql dates

Documentation:

SQL Server - Connectors | Microsoft Docs

------------

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

 

jbrit2020
Continued Contributor
Continued Contributor

Thanks for the help, doesn't work unfortunately as the SQL field returns date and time and will therefore never match Today(). I will try @eka24 approach

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,055)