Thanks, but i manage to find the soluction, and i post it here:
SELECT DRRUB, '' AS [Desc], Sum(DRVAL) AS Valor, Sum(DRQNTD) AS Qty, IIf(Sum(DRQNTD)=0,0,Sum(DRVAL)/Sum(DRQNTD)) AS UnitPrice INTO tblResult
FROM DRTIT
GROUP BY DRRUB, '', DRCOD
HAVING DRCOD='00764394';
The try that i made before...