我在vb.net中运行此语句时出错。以下错误 错误[42000] [Microsoft] [ODBC Microsoft Access驱动程序]查询表达式中的语法错误(缺少运算符)'Request.GodownFROM请求WHERE(((Request.Rdate)=#03/27/2017#)AND((Request.Godown) )= '印度'”。
sql = "SELECT Request.[Rdate], Request.[Item Name], Request.[Category], Request.[Unit], Request.[Quantity], Request.[Rate], Request.[Amount], Request.[Godown]" _
& "FROM Request WHERE Request.[Rdate]=#" & dtrdate.Value & "# AND Request.[Godown]='" & lblgodown.Text & "'"
Dim da As New System.Data.Odbc.OdbcDataAdapter(sql, con)
da.Fill(dt)
dgtvgo1.DataSource = dt
答案 0 :(得分:2)
在" [from ...]"之前需要一个空格。所以将第二行改为" [从..."