Date compare with Linq

Hi, is there anyone who can help me compare two dates in an excel sheet.
I would like to use Linq.

The Excel sheet looks like this:
Date From: 2002-01-03, 2010-01-01
Date To: 2020-01-01, 2022-01-01

And then want to get if the date is valid or passed.

Regards Mikael

find some starter help here:
FindNotMatchingDateFormatDates.xaml (6.8 KB)

DT_FilterDates_Yesterday.xaml (8.2 KB)

In case of you need more specific help, just provide us a sample data excel and elaborate more on

does mean. From date is before or same as To Date?


Thanks for the xaml files will look through them in a while.

Wrote a little wrong in my question, apologize for that.

I want to read out to date and compare it with today’s date. And if it is an older date, it should be printed: the date has passed.

Dates.xlsx (9.8 KB)
Heres the file

Find starter help here:
CheckDate_NotPassedToday_ResultColMessage.xaml (7.1 KB)

I would suggest to combine it with some parts from above shared XAMLs and filter out all dates not parseable into a seperate report. So the Bot would work more solid and reliable

Thank you so much for your help. Everything worked exactly as I had imagined. But I feel like I want to learn Linq properly. So I checked out this page:
Intro to LINQ - Visual Basic | Microsoft Learn

And i want to do the examples they have here.

I have this excel file as a database:

And i try this in an assign, in UiPath, it does not work:

What am I missing?

I get this error message: An expression is expected.

I hope you can guide me in the right direction.

With kind regards Micke

kindly note: LINQ is NOT SQL and the syntax is different.


  • the last ) in first line is to remove

dtTestDataOutput looks like a variable of datatype datatable. In that case the columns are referenced by

just refer to the provided xamls and crosscheck on how it was implemented

I really appreciate you helping me.

So the syntax on the guide i pointed to is SQL? it says

Ok, so i looked at the othe xaml file and changed the code to:
and got rid of the error codes, but the writeline in the for each is empty.
How is that?

And another question: If i write cust(Country).ToString it cant find any thing, why?

With kind regards Micke

let us do one thing and not mixing up topics. The origin topic was about date comparing with linq. And once it is solved just close the topic by marking the helping post as solution. Others, researching a similar solution will find it faster and direct.

About learning LINQ, following resources are helpfully:

In case of open questions will occur while studying LINQ, so just open a new topic and we will help you.

Yes i will do that.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.