Skip to main content

Notifications

Power Automate - Using Flows
Answered

Get rows(V2) Filter Query with date

(0) ShareShare
ReportReport
Posted on by 150

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 

 

 

 

 

  • dc7669 Profile Picture
    dc7669 150 on at
    Re: Get rows(V2) Filter Query with date

    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

  • Verified answer
    js-dattics Profile Picture
    js-dattics 98 on at
    Re: Get rows(V2) Filter Query with date

    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-sql-server

     

    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.

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard

Featured topics

Restore a deleted flow