>select SUM(FIELD1) AS FIELD1, SUM(PODET.ITEM_QUANT) AS ITEM_QUANT, POREC.PODET_PK >FROM POREC RIGHT JOIN PODET ON PODET.PODET_PK = POREC.PODET_PK GROUP BY > PODET.PODET_PK >HAVING ITEM_QUANT > 0 >>
select SUM(FIELD1) AS FIELD1, SUM(PODET.ITEM_QUANT) AS ITEM_QUANT, POREC.PODET_PK FROM POREC RIGHT JOIN PODET ON PODET.PODET_PK = POREC.PODET_PK GROUP BY PODET.PODET_PK HAVING SUM(Podet.ITEM_QUANT) > 0Having should have an aggreage function for Item_Quant. You can not reference a new field in the Having clause, so you must repeat the same expression. You can only reference a newly created alias in the ORDER BY clause of the SQL - Select.