Hello Folks ,
I have a linq query for table comparison but i need to change a condition that there is column in which unit is given ,if unit is Kg divide qty1 by 1000 and compare
Hi,
you want to modify a LINQ query to include a condition where you compare qty2 to qty1 after adjusting qty1 based on the unit. If the unit is “Kg,” you need to divide qty1 by 1000 before making the comparison. you can try below LINQ query:
In this query, I’ve added a check for the unit (x("Unit").ToString = "Kg") and adjusted qty1 accordingly (CDbl(x("qty1")) / 1000). The If statement is used to conditionally divide qty1 by 1000 if the unit is “Kg”; otherwise, it leaves qty1 unchanged. The comparison is then made between qty2 and the adjusted qty1.