cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

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
Highlighted
Community Support
Community Support

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.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

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.

View solution in original post

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (6,005)