I am attaching my exact file. Please help me to delete the records older to 2.5 months (76 days). I am not not getting correct data after applying filter using select method. It has date time and the format is Custom in the excel.
Its urgent, please. It would be great if you can provide me a working solution.
Also someone said : dt_irc1 = dt_irc1.AsEnumerable.Where(function(r) DateTime.ParseExact(r(“Requested”).toString,“MM/dd/yyyy hh:mm:ss tt”,nothing)>Today.AddDays(-76)).CopyToDataTable
But m not able to understand this . It errors “String is not recognized as a datetime variable.”
@kkpatel
for any reasons the hh:mm:ss Part leads to “String is not recognized as a datetime variable.” error
using an assign activity for a single ParseExact helped to isolate the issue
Maybe you can go for following workaround:
yourDataTableVar.AsEnumerable.Where(function ( r ) DateTime.ParseExact(r(“Requested”).toString.Substring(0,10),“MM/dd/yyyy”,CultureInfo.InvariantCulture)>Today.AddDays(-76)).CopyToDataTable