here my excel problem is this dates are coming in string format which conatins spaces in front and back of dates its taking like string i have tried filter data table but idid not work
check my execel attachment
can you try by linq and share me soultion in detail
yourRowVar(“InvDT”).toString.Trim should cleanse the value
e.g.
(From d in dtData.AsEnumerable
Let ds = d("InvDT").toString.Trim
Let dp = YourDateTimeParseStrategy(ds........).Date
Where dp #your-last-10-Days-Check#
Select r =d).CopyToDataTable
Hey, we did support with starter help, and requested your part results
Assign Activity
dtFiltered =
(From d In dtData.AsEnumerable
Let ds = d("InvDT").toString.Trim
Let dp = CDate(ds).Date
Where Not ( dp >= Now.AddDays(-10).Date And dp <= Now.Date )
Select r =d).CopyToDataTable
is about a value which is an empty string and not in relation with the LINQ
we can filter out e.g. by
(From d In dtData.AsEnumerable
Let ds = d("InvDT").toString.Trim
Where not String.IsNullOrEmpty(ds)
Let dp = CDate(ds).Date
Where Not (dp >= Now.AddDays(-10).Date And dp <= Now.Date )
Select r =d).CopyToDataTable