Código sql:
Ver originalSELECT S.fac, U.USUARIO, Tra.MOVIL, U.EMPRESA, Tra.VALOR + Tra.SOBRECARGO [CONSUMO]
FROM TRAFICO Tra
INNER JOIN ID_USUARIO U ON U.MOVIL = Tra.MOVIL
INNER JOIN (
SELECT MAX(FACTURA) AS fac, MOVIL
FROM TRAFICO
GROUP BY MOVIL
) S ON Tra.FACTURA=S.fac AND Tra.MOVIL=S.MOVIL
GROUP BY S.fac, U.USUARIO, U.EMPRESA, Tra.MOVIL
ORDER BY U.EMPRESA, U.USUARIO