确切的错误是:
Syntax error (missing operator) in query expression 'ServDate BETWEEN ? AND ? WHERE Description = ?'.
提前致谢。
cmd = New OleDbCommand("SELECT * FROM Services WHERE ServDate BETWEEN ? AND ? WHERE Description = ?", Con)
Prm = New OleDbParameter("ServDate", StartDate)
cmd.Parameters.Add(Prm)
Prm = New OleDbParameter("ServDate", EndDate)
cmd.Parameters.Add(Prm)
Prm = New OleDbParameter("Description", "Automatic Oil Delivery")
cmd.Parameters.Add(Prm)
答案 0 :(得分:2)
一个WHERE
子句应该有一个FROM
子句:
SELECT * FROM Services WHERE (ServDate BETWEEN ? AND ?) AND Description = ?