DataTable.Select correct syntax for string / double / decimal objects

UiPath snippet of For Each

Hello,

I am very new to UiPath and am struggling to figure out the correct syntax for doing a selecting of my datatable object to remove invalid rows.

Currently the code reads like this and I get an error because the Invoice Number column is a string, while the Amount to Pay column seems to be either a double or variable. The error is saying something along the lines of <> can not be used on a double / decimal variable.

Current Code:
Out_dtExcel.Select("[INVOICE NUMBER]<>’’ AND [Amount to Pay]<>’’").CopyToDataTable

Does anyone know how I can change this code syntax to include the Amount to Pay column basically not being blank and not zero (this column is double/decimal format, not a string)?

Ultimately, I want to filter out any rows from my datatable that do not have a value in the Invoice Number and Amount to Pay fields.

Thanks!

Hi @taxguy33
welcome to forum
can u try like this

dt2 = dt1.AsEnumerable().Where(Function(row) row(“INVOICE NUMBER”).ToString<>"" and row(“Amount to Pay”).ToString<>"").CopyToDataTable

or can u try with this code too

dt1.Select("[INVOICE NUMBER]<>"" AND [Amount to Pay]<>""").CopyToDataTable

Regards,
Nived N
Happy Automation