Hàm tạo n query không truyền giá trị vào
btamsgn > 14-07-14, 01:23 PM
Chào các bạn,
Chào các bạn,
Mình có câu lệnh sau bị lỗi ở phần truyền tham số I,I1,I2,I3,I4:
Dim I As Integer, I1 As Integer, I2 As Integer, I3 As Integer, I4 As Integer
I = 1
I1 = I + 1
I2 = I + 2
I3 = I + 3
I4 = I + 4
strsql = "SELECT CR5ADM.IDHD, CR5ADM.TENNPL, CR5ADM.DVT, CR5ADM.[" & I & "] AS A, CR5ATLHH.[" & I & "] AS B, CR5ANCAU.[" & I & "] AS C, CR5ADM.[" & I1 & "] AS D, CR5ATLHH.[" & I1 & "] AS E, CR5ANCAU.[" & I1 & "] AS F, CR5ADM.[" & I2 & "] & AS G, CR5ATLHH.[" & I2 & "] AS H, CR5ANCAU.[" & I2 & "] AS I, CR5ADM.[" & I3 & "] AS J, CR5ATLHH.[" & I3 & "] AS K, CR5ANCAU.[" & I3 & "] AS L, CR5ADM.[" & I4 & "] AS M, CR5ATLHH.[" & I4 & "] AS N, CR5ANCAU.[" & I4 & "] AS O, NZ([C])+NZ([F])+NZ([I])+NZ([L])+NZ([O]) AS TONG, " & TaoMa(J) & " AS CNN FROM (CR5ADM INNER JOIN CR5ANCAU ON (CR5ADM.TENNPL=CR5ANCAU.TENNPL) AND (CR5ADM.IDHD=CR5ANCAU.IDHD)) INNER JOIN CR5ATLHH ON (CR5ADM.TENNPL=CR5ATLHH.TENNPL) AND (CR5ADM.IDHD=CR5ATLHH.IDHD);"
Rất mong nhận được câu lệnh chỉnh sửa lại từ các bạn thanks,
Tâm