DT.select

Hi Everyone,

I am using DT.select method to get Active Status and Inactive status,

DT.Select("[StartDate] <= #"+ CurrentDate.ToString +"#AND [EndDate] >= #"+CurrentDate.ToString+"#").Count

For above code, i am checking if Current date is todays date and
Start date is in Past or Today,
End date is today or in Future,
then we set inactive the account.
But this query is not working.

better to tell us what is not working.

maybe some analysis within the datatable as described below can help:
:ambulance: :sos: [FirstAid] Datatable: Debug & Analysis invalid DateTime Strings / String to DateTime Parsing Issues - News / Tutorials - UiPath Community Forum

here we would suggest

  • to look inside the datatable
  • to prototype the Selext expression in parts directly within the immediate panel

As an alternate we do have also LINQ in place

The non working thing is,

As per this script,
If the start date is <=Today then account set to inactive.
but this script is not working, it is only working when end date is in future. If end date is today then it fails.

just go through the provided link and please share with us the details of the datatable (screenshot from the immediate panel statements) thanks