1

我在查询表达式中收到错误“语法错误(缺少运算符):

'tblFICL.Product = Muni/Money Market AND tblFICL.Broker_Code = WELLS'

完整的 vba 查询如下。我猜这与我的变量prdctbkr. 我在此查询中缺少什么语法?

'Set and Excecute SQL Command'
strSQL = "SELECT tblFICL.Email " _
    & " FROM tblFICL " _
    & " WHERE tblFICL.Product = " & prdct & " AND tblFICL.Broker_Code = " & bkr & ""

整天都在看这个,任何帮助都会非常感激。

4

1 回答 1

4

您可能需要在值之前和之后使用撇号。试试下面的代码

strSQL = "SELECT tblFICL.Email " _
    & " FROM tblFICL " _
    & " WHERE tblFICL.Product = '" & prdct & "' AND tblFICL.Broker_Code = '" & bkr & "'"
于 2013-07-24T19:42:00.637 回答