SQL INNER JOIN查询表达式的语法错误

时间:2013-09-10 03:10:05

标签: vb6

我有一个错误,它说:“查询Expression中的语法错误(缺少运算符)。

这是我的代码:

"SELECT AttHadir.IDUser, Hadir.NamaUser, AttHadir.JamMasuk, AttHadir.Threshold," & _
"AttHadir.ModVerifikasi, AttHadir.ModVerifikasi FROM AttHadir INNER JOIN Hadir ON AttHadir.IDUser = Hadir.IDUser" & _
"WHERE AttHadir.IDUser='" & TBox(0).Text & "' AND MONTH(AttHadir.JamMasuk) AS Bulan ='" & Combo(0).Text & "'" & _
"AND YEAR(AttHadir.JamMasuk) AS Tahun='" & Combo(1).Text & "'"

每个人都知道我的代码是正确的吗? 感谢

1 个答案:

答案 0 :(得分:0)

您的字符串将创建为:

SELECT AttHadir.IDUser, Hadir.NamaUser, AttHadir.JamMasuk, AttHadir.Threshold,AttHadir.ModVerifikasi, AttHadir.ModVerifikasi FROM AttHadir INNER JOIN Hadir ON AttHadir.IDUser = Hadir.IDUserWHERE AttHadir.IDUser='' AND MONTH(AttHadir.JamMasuk) AS Bulan =''AND YEAR(AttHadir.JamMasuk) AS Tahun=' '

我认为您在AttHadir.ModVerifikasiWHERE AttHadir.IDUserAND YEAR(AttHadir.JamMasuk)

之前缺少空格