cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mmattar
Responsive Resident
Responsive Resident

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

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

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

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (39,972)