cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jonathanO
Level: Powered On

Filter SQL Date field issue

I have a flow with a SQL Get Rows action.  The action has a simple filter:

AsofDate eq '2015-06-16'

 

When I trace the query using SQL Pofiler, I see that flow is sending the following SQL for the where clause:

 

execute sp_executesql N'select top 1
(omitted columns and tablename)
where 0 = 1'

 

 

Any idea why Flow is sending 0 = 1 for the where clause?  This does not make any sense.  The Get Rows action is returning an empty result set.  The table has many records with that value in that column.

 

Flow Result:
flow_asofdate_filter.PNG

 

Action Configuration: 
flow_date_formula.PNG

 

I also tried the date with single quotes around it.  I also tried typing the date without the formula, like '2015-06-16'.  

The column is a Date column.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filter SQL Date field issue

Hi jonathanO,

 

Please take this doc for a reference:
https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-odata-query-operations-in-sharepoint-...

 

For your scenario, you may try to use the following function:

Year(birthday) eq 2017 and month(birthday) eq 10 and day(birthday) eq 06

 

I have tested it on my side, and it is working fine.

3.PNG

 

Please try it on your side. Hope this could be a reference for you.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 REPLY 1
Community Support Team
Community Support Team

Re: Filter SQL Date field issue

Hi jonathanO,

 

Please take this doc for a reference:
https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-odata-query-operations-in-sharepoint-...

 

For your scenario, you may try to use the following function:

Year(birthday) eq 2017 and month(birthday) eq 10 and day(birthday) eq 06

 

I have tested it on my side, and it is working fine.

3.PNG

 

Please try it on your side. Hope this could be a reference for you.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 483 members 4,574 guests
Please welcome our newest community members: