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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (4,231)