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

SQL query get rows with date

Hello, how can i translate this query into filter inside the sql get rows?
I need to run this query every friday and send an email to Manager which employees on Holidays

select author,
CONVERT(date,dateFrom) as dateFrom,
CONVERT(date,dateTo) as dateTo
FROM [dbo].[RequestsList]
where dateFrom >= dateadd(day, 1-datepart(dw, getdate()), CONVERT(date,getdate()))
AND dateTo < dateadd(day, 8-datepart(dw, getdate()), CONVERT(date,getdate())) 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

FInd solution about how to translate my query into ODATA Filter here:

https://powerusers.microsoft.com/t5/Building-Flows/How-do-I-determine-the-Start-and-End-Dates-of-the...

And now filter looks like this:
Screenshot_2.png

Hope it helps to guys, who faced with same problem 😉

View solution in original post

3 REPLIES 3
v-alzhan-msft
Community Support
Community Support

Hi @Anonymous ,

 

Does the query are used to get rows from SQL Server table which employees on holidays?

If yes, you could create flow with Get rows action from SQL Server, and you could add a Filter Query action for getting the special rows, then you could create table to the rows and send it to the manager.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Yes, it's exact what i need, but how to translate this filter query into ODATA filter in Get Rows ?

For now i'm doing like this 

InkedScreenshot_1_LI.jpg

formatDateTime(utcNow(),'yyyy-MM-dd HH:mm:ss')

But get an error:
')' or ',' expected at position 76 in 'assignedTo eq 'email@emailsite.com'
AND dateFrom ge dateadd(day, 1-datepart(dw, '2020-09-16 10:11:31'), CONVERT(date, '2020-09-16 10:11:31'))
AND dateTo lt dateadd(day, 8-datepart(dw, '2020-09-16 10:11:31'), CONVERT(date, '2020-09-16 10:11:31'))'.



Anonymous
Not applicable

FInd solution about how to translate my query into ODATA Filter here:

https://powerusers.microsoft.com/t5/Building-Flows/How-do-I-determine-the-Start-and-End-Dates-of-the...

And now filter looks like this:
Screenshot_2.png

Hope it helps to guys, who faced with same problem 😉

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (3,191)