I use LINQ expression should filter one column value which >-1 and <1, However, I cannot get the right data, who can help?

Hi @Lori

Could you give this a try

Filter datatable

where
“AP Invoice Number” = Blank
and
“AR Invoice Number” not Blank
and
“Issue Type”=“Price Diff” or Blank
and
“Diff” column value "-1 < and < 1 ",

(
	From d In CSVDT.AsEnumerable
	_
	Let APInvoiceNum = d("AP Invoice Number").ToString.Trim().ToUpper()
	Let ex = d("Issue Type").ToString.Trim().ToUpper()
	Let diff = Convert.ToDouble(d("Diff").ToString)
	_
	Let c1 = String.IsNullOrEmpty(APInvoiceNum)
	Let c2 = Not d("AR Invoice Number").ToString.Trim().ToUpper().Equals("")
	Let c3 = ex.Equals("PRICE DIFF") Or String.IsNullOrEmpty(ex)
	Let c4 = Math.Abs(diff) < 1
	_
	Where c1 And c2 And c3 And c4
	_
	Select r=d
).CopyToDataTable
1 Like