Update table từ query ? (2 người xem)

Liên hệ QC

Người dùng đang xem chủ đề này

darkmoon

Thành viên chính thức
Tham gia
19/12/06
Bài viết
95
Được thích
158
Nghề nghiệp
Thất nghiệp
Em muốn update 1 table từ 1 query. Khi chạy câu lệnh update toàn báo lỗi "Operation must use an updateable query". Em phải làm sao ?

Query1:
Mã:
SELECT  Left(tblSoDuTaiKhoan.MaTaiKhoan,Len([Forms]![frmSoDuTaiKhoan]![MaTaiKhoan])-1)  AS MaTaiKhoan, Sum(tblSoDuTaiKhoan.DuNo) AS DuNo
FROM tblSoDuTaiKhoan
GROUP BY Left([tblSoDuTaiKhoan].[MaTaiKhoan],Len([Forms]![frmSoDuTaiKhoan]![MaTaiKhoan])-1), Len([tblSoDuTaiKhoan].[MaTaiKhoan])
HAVING  (((Left([tblSoDuTaiKhoan].[MaTaiKhoan],Len([Forms]![frmSoDuTaiKhoan]![MaTaiKhoan])-1))=Left([Forms]![frmSoDuTaiKhoan]![MaTaiKhoan],Len([Forms]![frmSoDuTaiKhoan]![MaTaiKhoan])-1))  AND  ((Len([tblSoDuTaiKhoan].[MaTaiKhoan]))>Len([Forms]![frmSoDuTaiKhoan]![MaTaiKhoan])-1));

Câu lệnh update:
Mã:
UPDATE tblSoDuTaiKhoan INNER JOIN Query1 ON tblSoDuTaiKhoan.MaTaiKhoan=Query1.MaTaiKhoan SET tblSoDuTaiKhoan.DuNo = Query1.DuNo;

Thanks.
 
Web KT

Bài viết mới nhất

Back
Top Bottom