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

Get rows(V2) Filter Query with date

I want to query for a table in a SQL Database for a Date field greater than a certain date. 

 

In "Filter Query" field, I put in "ExpDate ge '2020-07-18'

 

When I ran this Flow, I got an error saying "We cannot apply operator < to types Text and DateTime".

 

ExpDate is a date field in the SQL table. 

 

So, what should the syntax be?  

 

I set this Flow up a few months ago and it was working back then.  Now, I revisited it and it is not working.  

 

Dan Chan 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Resolver I
Resolver I

Hi.

 

You can't delegate filtering by dates on SQL within Power Platform.

js-dattics_0-1595180574226.png

 

Please check all the delegations: https://docs.microsoft.com/en-us/connectors/sql/#power-apps-delegable-functions-and-operations-for-s...

 

As stated on Microsoft site:

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.

 

View solution in original post

2 REPLIES 2
Resolver I
Resolver I

Hi.

 

You can't delegate filtering by dates on SQL within Power Platform.

js-dattics_0-1595180574226.png

 

Please check all the delegations: https://docs.microsoft.com/en-us/connectors/sql/#power-apps-delegable-functions-and-operations-for-s...

 

As stated on Microsoft site:

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.

 

View solution in original post

Hi @js-dattics , 

 

This WORKED!  THANKS!  

 

I think the syntax I used ( In "Filter Query" field, I put in "ExpDate ge '2020-07-18')   did work as a few months ago.   Something must have changed.  Regardless, what matters now is how to fix it and your suggestion DID WORK!! 

 

Thanks!  

 

Dan Chan

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (25,599)