web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / SQL query get rows wit...
Power Automate
Answered

SQL query get rows with date

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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())) 

Categories:
I have the same question (0)
  • v-alzhan-msft Profile Picture
    Microsoft Employee on at

    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.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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'))'.



  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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-current-week/td-p/521321

    And now filter looks like this:
    Screenshot_2.png

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 813

#3
Haque Profile Picture

Haque 526

Last 30 days Overall leaderboard