nicebike00 > 22-11-13, 12:41 PM
ttm20062008 > 22-11-13, 02:48 PM
SELECT LOAIGAO.MAGAO, LOAIGAO.TENGAO, LOAIGAO.DACDIEM, LOAIGAO.GIABAN, Sum(CTHD.SOKG) AS SumOfSOKG
FROM LOAIGAO LEFT JOIN CTHD ON LOAIGAO.MAGAO = CTHD.MAGAO
GROUP BY LOAIGAO.MAGAO, LOAIGAO.TENGAO, LOAIGAO.DACDIEM, LOAIGAO.GIABAN;
Xuân Thanh > 23-11-13, 11:55 AM
SELECT CTHD.MAGAO, LOAIGAO.TENGAO, LOAIGAO.DACDIEM, LOAIGAO.GIABAN, Sum(CTHD.SOKG) AS TongSoLuongBan, Sum(CTHD.GIAM) AS TongSoLuongGiam
FROM LOAIGAO INNER JOIN CTHD ON LOAIGAO.MAGAO = CTHD.MAGAO
GROUP BY CTHD.MAGAO, LOAIGAO.TENGAO, LOAIGAO.DACDIEM, LOAIGAO.GIABAN
HAVING (((LOAIGAO.DACDIEM)=[DacDiemGi]) AND ((LOAIGAO.GIABAN)=[GiaBaoNhieu]));