Use of Absolute Function in Datatable Select Query

Input: Datatable with a single column and values as below

Requirement: To get values which have absolute value greater than 25
Expected Output: -98.05,-56,75.28
Current Logic Implemented:“Convert(Column1,‘System.Double’))>’”+Var.ToString+"’").CopyToDataTable
This is providing output as 75.28 only which is incorrect.

Need help…!!!

Hi @PrachiSinghDeloitte,

Try this one.
(From dr in DT1 where Math.abs(Convert.ToInt32(dr.item(“Column1”)))>
Convert.ToInt32(Var) select dr).ToArray().CopyToDataTable()`

1 Like