cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter Query - Get Rows from SQL Server

Hi everyone, 

I want to Get Rows from SQL Server that have been created precisely three days ago.

The data type of the column in SQL is date (no time). 


I tried the following, and the flow ran successfully, but I don't get any rows?

Date_x0020_Install eq '@{addDays(utcnow('yyyy-MM-dd'),-3)}'

 

The name of the column in SQL has space. That's why I have added "_x0020_".

 

seryil_0-1600690669438.png

 

Thank you in advance 🙂

 

15 REPLIES 15
ChristianAbata
Community Champion
Community Champion

hi @Anonymous with your expression you have this output

2020-09-18T00:00:00.0000000

So I if you need just the date you can try with this expression: 

first(split(addDays(utcnow('yyyy-MM-dd'),-3),'T'))

and your output could be like this:

2020-09-18



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Anonymous
Not applicable

Hi @ChristianAbata


The flow ran successfully, but again I didn't receive any rows.

 

seryil_0-1600696426892.png

 

My table has data from that date, so that isn't a problem.

 

seryil_0-1600696586884.png

 

ohh @Anonymous  your date Install is a string o Date format? Please try to get your data without Filter and then try to see what is the format that Power Automate is reading your data could be diferent.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Anonymous
Not applicable

Hi @ChristianAbata,

This is the format in SQL

 

seryil_0-1600760680399.png

 

And this is the output in Power Automate:

 

seryil_1-1600760812650.png

 



 

thanks @Anonymous  please try with this expression

 

concat(addDays(utcnow(),-3,'yyyy-MM-dd'),'T:00:00:00Z')


Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Anonymous
Not applicable

Hi @ChristianAbata,

Still no output 😞

 

Date_x0020_Install eq '@{concat(addDays(utcnow(),-3, 'yyyy-MM-dd' ), 'T:00:00:00Z' )}'

 

seryil_0-1600779274633.png

 

@Anonymous  please make shure that you have data 19-09-2020 could you do a little search?



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Anonymous
Not applicable

@ChristianAbata Yes, I have data from that date. 

 

seryil_0-1600779890674.png


You had a colon between T and 0 in your expression. I assume that is incorrect?
I removed it, and it still doesn't work. 

weird @Anonymous  just to test something more, could you leave your SQL silter empty and then after this action can you add a filter array and test with the expression that I gave you?

 

ChristianAbata_0-1600780306166.png

filter array.PNG



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Anonymous
Not applicable

@ChristianAbata Doesn't work either. But I removed the filter and tried to search after the specific date in the output with CTRL + F, and it seems like I don't get all the rows from SQL. 

If I search "Date_x0020_Install", then it can only find 1689 rows, and I have a lot more rows in the table in SQL.

 

seryil_0-1600781273509.png

 

Can it be true that there is a limit?

ohhh @Anonymous  please try to configure this 

excel.PNG



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Anonymous
Not applicable

@ChristianAbata I get all rows now, but still doesn't work. I tried to hardcode it with the following expression: Date_x0020_Install eq '2020-09-19T00:00:00Z' and that doesn't work either. The filter works with normal text columns but not date 😞


@Anonymous  please try with the other action



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Anonymous
Not applicable

Hi @ChristianAbata 

I tried both expressions, and it still doesn't work.

 

Date_x0020_Install eq '@{concat(addDays(utcnow(),-3,'yyyy-MM-dd'),'T00:00:00Z')}'
 
Date_x0020_Install eq '@{first(split(addDays(utcnow('yyyy-MM-dd'),-3),'T')))}'


I hope there is a solution to this. 

 

@Anonymous  could you share an screanshot?



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,442)