Showing results for 
Search instead for 
Did you mean: 
New Member

SQL "Get rows" filter by datetime in a range

Hello everyone,


I'm sorry, if this question has been answered before, but I just read countless threads, while still having no solution.


I'm trying to fetch specific rows inside of a SQL-table, where the value of a datetime column should be in between of today and 14 days from now.


Thank you very much in advance!

Community Champion
Community Champion

Hi @Dribbler31 


The easiest way would be to do a stored procedure with that query and then call it from Power Automate using the "Execute Stored Procedure" action.


The query can be something like this:

select * from <table> where <date time column> between DATEADD(day,-14,GETDATE()) and getdate()


I'm doing the query from memory, so apologies if the syntax is not 100% correct.


Is this what you need?



If I have answered your question, please mark it as "Accept as Solution." It will help other members finding the solution faster. If you like my response, please give it a Thumbs Up. 👍
Otherwise, reply to it, and the community will do its best to help you.


Helpful resources

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,460)