cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver III
Resolver III

Filter Querys SQL

Hello,

 

I am trying to Get Rows(V2) from a SQL Server, i need to filter based off of a DateTime sql column that has the format of 2019-08-15 10:17:32.000, i need to get all records that are a day before the current day.   

 

Another Filter as well to get all records that are less than this result 'day before the current day'.

 

To put into an email and show New Records and old records.

 

i got a compose Data operation of 

formatDateTime(addDays(utcNow(), -1),'yyyy/MM/dd'), im getting error when i compare this output to my sql datetime column. If anyone can assist, id appreicate it.
 
Thanks
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: Filter Querys SQL

Hi @mmattar 

 

You can add filters by Year Month and Date directly as filter when calling sql

 

Year(DateColumn) ge @{formatDateTime( utcNow(),'yyyy')} and month(DateColumn) ge @{formatDateTime( utcNow(),'MM')} and day(DateColumn) ge @{formatDateTime( utcNow(),'dd')}

 

This is just an example

you can do addDays( utcNow(),-1) for the day part and run above logic

 

Regards,

Reza Dorrani

 

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
Dual Super User
Dual Super User

Re: Filter Querys SQL

Hi @mmattar 

 

You can add filters by Year Month and Date directly as filter when calling sql

 

Year(DateColumn) ge @{formatDateTime( utcNow(),'yyyy')} and month(DateColumn) ge @{formatDateTime( utcNow(),'MM')} and day(DateColumn) ge @{formatDateTime( utcNow(),'dd')}

 

This is just an example

you can do addDays( utcNow(),-1) for the day part and run above logic

 

Regards,

Reza Dorrani

 

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 (10,815)