Filtering with current year

Hi team ,

when iam trying to extract one datatable it is getting like this … in the last row we have a date like “6/21/2023” so i have to check that date comes under current year date or not … and i want a expression for that … that expression i have to use in only filterdatatable activity

Hi @Nikhil_Katta

You can use an IF condition:

DateTime.ParseExact(currentRow(“Column3”).toString, “MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture).Year= Now.Year

i have to use in filter data table only…

Hi @Nikhil_Katta

Using Filter DataTable, you won’t be able to apply this logic directly. but you can use inside an assign activity
DTRecords= dtAll.AsEnumerable.Where(Function(row) DateTime.ParseExact(row(“Column3”).toString, “MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture).Year=Now.Year).CopyToDataTable

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