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
Solved! Go to Solution.
Hi.
You can't delegate filtering by dates on SQL within Power Platform.
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.
Hi.
You can't delegate filtering by dates on SQL within Power Platform.
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.
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
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
14 | |
5 | |
4 | |
4 | |
4 |