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

View solution in original post

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (3,562)