ChiMai > 24-03-17, 12:45 PM
tranthanhan1962 > 25-03-17, 07:41 AM
ChiMai > 25-03-17, 12:18 PM
SELECT tblHoaDonBanHang.NgayBan, tblHoaDonBanHang.soHD AS SoCT, tblHoaDonBanHang.idDoiTuong AS KhachHang, tblHoaDonBanHang.DienGiai AS DienGiaiM, [SlgB]*[DonGiaBan] AS SoTienHang, 0 AS SoTienThu
FROM tblHoaDonBanHang INNER JOIN tblChiTietBanHang ON tblHoaDonBanHang.soHD = tblChiTietBanHang.soHD
WHERE (((tblHoaDonBanHang.NgayBan) Between [Forms]![F_CongNoKH]![TuNgay] And [Forms]![F_CongNoKH]![DenNgay]) AND ((tblHoaDonBanHang.idDoiTuong)=[Forms]![F_CongNoKH]![cbKhachHang]));
UNION ALL SELECT QUY.Ngay, QUY.So AS SoCT, QUY.doituong AS KhachHang, QUY.[Noi dung] AS DienGiaiM, 0 AS SoTienHang, QUY.Thu AS SoTienThu
FROM QUY
WHERE (((QUY.Ngay) Between [Forms]![F_CongNoKH]![TuNgay] And [Forms]![F_CongNoKH]![DenNgay]) AND ((QUY.doituong)=[Forms]![F_CongNoKH]![cbKhachHang]));