Assign : Cannot perform '=' operation on System.String and System.Int64

Hi everyone:
in an excel application scope, i use assign to do selection: datatable.Select (“columnname1=‘shanghai Mcd company’ and account = 709457752725”), it works quite well.

but when i add another similar sentence like: duizhang.Select (“columnname1=‘shanghai Mcd company’ and account = 709457752725 or columnname1 = ‘beijing Mcd company’ and account = 687357752727”), it is wrong, and the error shows:Assign : Cannot perform ‘=’ operation on System.String and System.Int64.

could sb tell me the reason? many thanks.

convert(columnname1, ‘System.Int64’) = 709457752725

1 Like

thank u very much, and could u tell me more detail, please? how do i use this sentence in uipath? put it in “assign” activity or?

@vvaidya thank u very much, could u tell me some detail? how do i use this sentence in uipath? put it in “assign” activity or? i use the above"datatable.select……" sentence in “assign”,

did you try this way?

duizhang.Select (“columnname1=‘shanghai Mcd company’ and convert(account , ‘System.Int64’) = 709457752725 or columnname1 = ‘beijing Mcd company’ and convert(account , ‘System.Int64’)= 687357752727”)

@vvaidya hello, i see, thanks, but when i tried like what you write, uipath assign activity shows:Input string was not in a correct format. and when i put it in write line, it says:Invalid type name ‘system.int64’. do u know how to solve this? many thanks.

Did you try this way converting int to string then converting column to int64

duizhang.Select (“columnname1=‘shanghai Mcd company’ and account = ‘709457752725’ or columnname1 = ‘beijing Mcd company’ and account = ‘687357752727’”)

@it works, thank u so much

I have also same issue can you give solution.
FileDt.Select("[Delivered Qty] = ’ ’ ").CopyToDataTable

DataRow filteredRows = dt.Select(“Name LIKE '%” + searchstring + “%’ OR convert(R_Year, System.String) like '%” + searchstring + “%’ OR Studios LIKE '%” + searchstring + “%’ OR Kinds LIKE '%” + searchstring + “%'”);

It works for me