Select Partno ; > , Sum (RealCost) As RealCost ; > , Sum (PostedCost) As PostedCost ; > , Sum (RealCost - PostedCost) As Variance ; > , Sum (1) As Count ; > , Sum (NItems) As NItems ; > ; > from c_Source ; ; > group By 1 ; ; > into Cursor c_Browse Readwrite>I'd like to be able to reference the RealCost field in the result in the HAVING phrase ... HAVING RealCost # 0 ... but I get an error message because of the name conflict with the field RealCost in the source cursor.
Select Partno ; , Sum (RealCost) As RealCost ; , Sum (PostedCost) As PostedCost ; , Sum (RealCost - PostedCost) As Variance ; , Sum (1) As Count ; , Sum (NItems) As NItems ; ; from c_Source ; ; group By 1 ; ; into Cursor c_Browse Readwrite ; having sum(RealCost) <> 0