Date to string conversion

Hi team,

Can anyone help me to solve error – string to type date conversion is not valid , generated through below statement enumerable.where(Function (x) CDate(x(date)) <

1 Like


Try with parse exact method…


@Hitesh1 Try the below one with assign activity

Variable of type data table DT1 = DT.AsEnumerable.Where(Function(x) DateTime.ParseExact(x("Date").ToString, "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("MM/dd/yyyy")<Now.AddDays(-5).ToString("MM/dd/yyyy")).CopyToDataTable
  • DT is the data table contains the actual data
  • DT.AsEnumerable.Where(Function(x) DateTime.ParseExact(x("Date").ToString, "MM/dd/yyyy", here MM/dd/yyyy is the format that contains in data table. You can change this according to the format that your data table column has

Check attached workflow for ref (3.2 KB)