cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mmattar
Level 8

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
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
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

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

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!

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!

Users online (5,245)