KheNgot > 13-09-20, 09:48 PM
tranthanhan1962 > 14-09-20, 08:22 AM
KheNgot > 14-09-20, 07:43 PM
TRANSFORM Sum(qrPS.SOLUONG) AS Slg
SELECT qrPS.CODE, qrPS.NAME
FROM qrPS
WHERE (((qrPS.ThangPS)=[Forms]![F_BCNGAY]![txtThang])) OR (((qrPS.NamPS)=[Forms]![F_BCNGAY]![txtNam]))
GROUP BY qrPS.CODE, qrPS.NAME
PIVOT qrPS.NgayPS;
tranthanhan1962 > 15-09-20, 12:45 AM
KheNgot > 15-09-20, 08:05 PM
SELECT Day([NGAY]) AS NgayPS, Month([NGAY]) AS ThangPS, Year([NGAY]) AS NamPS, tblPSS.CODE, tblDMSP.NAME, tblPSS.SOLUONG
FROM tblDMSP INNER JOIN tblPSS ON tblDMSP.CODE = tblPSS.CODE
WHERE (((Month([NGAY]))=[Forms]![F_BCNGAY]![txtThang]) AND ((Year([NGAY]))=[Forms]![F_BCNGAY]![txtNam]))
ORDER BY Day([NGAY]), Month([NGAY]), Year([NGAY]), tblPSS.CODE;
ongke0711 > 16-09-20, 11:07 AM
(15-09-20, 08:05 PM)KheNgot Đã viết: Mình đã sửa lại "qrPS" và chạy thì ok. Nhưng khi mở form F_BCNGAY thì nó vẫn lỗi không chạy được. Không biết còn phải sửa chỗ nào nữa ko ạ?
Cám ơn nhiều!
PARAMETERS [Forms]![F_BCNGAY]![txtNam] Short, [Forms]![F_BCNGAY]![txtThang] Short;
TRANSFORM Sum(tblPSS.SOLUONG) AS SumOfSOLUONG
SELECT tblPSS.CODE, tblDMSP.NAME
FROM tblDMSP INNER JOIN tblPSS ON tblDMSP.CODE = tblPSS.CODE
WHERE (((Month([NGAY]))=Forms!F_BCNGAY!txtThang) And ((Year([NGAY]))=Forms!F_BCNGAY!txtNam))
GROUP BY tblPSS.CODE, tblDMSP.NAME
PIVOT Day([NGAY]) In (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31);