Mega Code Archive

 
Categories / Delphi / ADO Database
 

A sum[if[ , ,0]] always returns 0

Question: The following expression always returns 0 when using the QRExpr component in Delphi 3: Sum(if(Query1.CartonID = 'SI', Query1.Caliper, 0)) Why? Answer: Change the 0 to 0.0 and the Sum function will work as expected.