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 / How to filter a date c...
Power Automate
Answered

How to filter a date column by using range in PAD

(0) ShareShare
ReportReport
Posted on by 150

@Nived_Nambiar @Agnius  

I want to filter the rows In the start date column range between (ex:- 09-10-2023 to 16-10-2023)

 

Dates.PNG

 Is there any Linq Query, because i have to read more than 2000 rows

  • UshaJyothiKasibhotla Profile Picture
    229 Moderator on at

    Use Excel as data base 

    and write SQL query to get particular data between the dates

     

    Hope this helps

    usha

  • UshaJyothiKasibhotla Profile Picture
    229 Moderator on at

    And also you can try this linq

     

    dt.Select("[Letter Date] >= '#08/01/2019#' AND [Letter Date] <= '#11/20/2019#'").CopyToDataTable

  • UshaJyothiKasibhotla Profile Picture
    229 Moderator on at

    Try this also

     

    Enumerable.Range(5,16).ToArray.Select(Function(d) New Datetime(Now.year,Now.Month,d).Date).Toarray

  • UshaJyothiKasibhotla Profile Picture
    229 Moderator on at

    5 and 16 is the dates which we need that range between

  • kiran_g Profile Picture
    150 on at

    Does this only work for the Current month & year?  

  • UshaJyothiKasibhotla Profile Picture
    229 Moderator on at

    No it works for any range of dates 

  • Verified answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @kiran_g 

     

    There are two options 

     

    1) Connect excel as DataBase

     

    This option helps to read large excel file in form of database tables and help to execute SQL Queries on it. 

     

    See below link for documentation with respect to this:

    https://www.matthewdevaney.com/power-automate-desktop-read-filter-excel-with-sql-query/

     

     

    Linq queries

     

    It helps to perform manipulation on excel file (in datatable form) in easy and efficient way.

     

    See below article written @LokeshBysani  🙂 on how to execute linq query in power automate desktop 

     

    https://www.linkedin.com/pulse/how-run-net-script-action-empowers-data-table-power-automate-bysani/

     

    Coming to your question, if you want to try using linq query , try using below code

     

    dt2= dt1.AsEnumerable().Where(Function(row) CDate(row("ColumnName").ToString.Trim)>"09-10-2023" And CDate(row("ColumnName").ToString.Trim)<"16-10-2023").CopyToDataTable()

     

    where dt1 is input argument of datatable type to Run .net script action which is input datatable which is obtained by reading the excel, while dt2 is output datatable obtained after filtering using linq query which is the output argument.

     

    Hope it helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 330

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 123

Last 30 days Overall leaderboard