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

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

 

1 REPLY 1
Super User
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

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

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

Users Online
Currently online: 179 members 5,438 guests
Please welcome our newest community members: