Exception:Assign : Min (114) must be less than or equal to max (-1) in a Range object



Can some one please help with the following error message?

Assign : Min (114) must be less than or equal to max (-1) in a Range object.

It is displayed as ‘Argument Exception’. I encountered this while using dt.select().



Hey @Shatakshi_Mishra

The above problem starts with your select query expression, it looks like a numeric expression to the query parser, not a string.

There is things in the background about index which builds with string so just whatever variable you are using i guess that is of Int32 type just convert that into String by using .ToString() then it should solve your problem.



Hey @aksh1yadav Thanks for replying
I am using assign activity as below,

dte = Exl1.Select(“Dt =’”+stDaEx_3+"’")(0)(“Day”).ToString()

Dt is the column name,
Day is column name.

I am still getting the error. : (


Did you try using Lamda Expression?

Exl1.AsEnumerable.Where(Function(r) r.Field(of string)("Dt")=stDaEx_3)(0)("Day").ToString

Someone else had same issue in the past, not sure if it got resolved.


Hey @vvaidya Thanks for replying!
I tried doing what you have showed but that gives an error:

'Unable to cast object of type ‘System.DateTime’ to ‘System.String’ '.

Same holds true for other data types as well, Unable to convert to string.


Did you try modifying the types(Column & Variable) to DateTime ?


It’s showing the same error for any data type.
Somehow the ToString() is not getting invoked.


Hi @Shatakshi_Mishra, have you ever solve this problem? I met the same situation when using Datatable.Select.
It’s like:
totalTable.Select(“Start Date = '”+row.Item(“A”).ToString+"’ and End Date = ‘"+row.Item(“B”).ToString+"’")

I guess it might caused by one of the column I used to select is date format but I can’t find the solution.


Is there a solution to this?
I’m doing: dtFiltered = dtFacturiRidicata.Select("[Nr. Fiscal Fact] = '"+dtDistinctFacturi.Rows(InvoiceCounter).Item("Nr. Fiscal Fact").ToString+"'").CopyToDataTable and I’m getting: Invoke GetTransactionData workflow: Assign : Min (1464) must be less than or equal to max (-1) in a Range object.