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.

View solution in original post

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.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,690)