I want to remove saturday and sunday from the 1 month

27-08-2025
28-08-2025
29-08-2025
30-08-2025
31-08-2025
01-09-2025
02-09-2025
03-09-2025
04-09-2025
05-09-2025
06-09-2025
07-09-2025
08-09-2025
09-09-2025
10-09-2025
11-09-2025
from this dates

Hello @Sameer_Pandey,

I had tried this, and I have mentioned the XAML — please refer to it.

datsysj.xaml (11.1 KB)

1 Like

@Sameer_Pandey,

If you have these dates in the List(Of DateTime) like the below

datesList = New List(Of DateTime) From {
    #08/27/2025#, #08/28/2025#, #08/29/2025#, #08/30/2025#,
    #08/31/2025#, #09/01/2025#, #09/02/2025#, #09/03/2025#,
    #09/04/2025#, #09/05/2025#, #09/06/2025#, #09/07/2025#,
    #09/08/2025#, #09/09/2025#, #09/10/2025#, #09/11/2025#
}

You can use this LINQ

filteredDates = dateList.Where(Function(d) d.DayOfWeek <> DayOfWeek.Saturday AndAlso d.DayOfWeek <> DayOfWeek.Sunday).ToList()

filteredDates should be of datatype List(Of DateTime)

Output:

Unfortunately it not in detailed mentioned which exact input / Datatype is to handle and what exact output Datatype is targeted

When it is about generations we can use the following approach:
grafik

and modifying it e.g. by dynamizing it with variables an/or shifting it to the Query syntax

Variables:
startDate | DateTime = #08/27/2025#
length | int32 = 16

Generation (output String Array)
arrFilteredDates =

(From i in Enumerable.Range(0,16)
Let d = startDate.AddDays(i)
Where Not {0,6}.contains(d.DayOfWeek)
Select r = d.ToString("dd-MM-yyyy")).toArray

About LINQ also have a look here:
[HowTo] LINQ (VB.Net) Learning Catalogue - Help / Something Else - UiPath Community Forum

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