Reputation: 131
I have an error running this statement in vb.net.The following error ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Request.GodownFROM Request WHERE (((Request.Rdate)=#03/27/2017#) AND ((Request.Godown)='Indian''.
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
Upvotes: 1
Views: 45
Reputation: 156
You need a space before the "[from...]". So change the second line to " [from..."
Upvotes: 2