psycoperl
Active Member
- Joined
- Oct 23, 2007
- Messages
- 339
- Office Version
- 365
- 2016
- Platform
- Windows
- MacOS
- Web
I am getting a Run-time error '-2147217900 (80040e14)':
Syntax error (missing operator) in query expression
'(((Len(Trim(tblTempSimNetResultData.STUDENTID)))<>9)) or (((tblTempSimNetResultData.STUDENTID) Like "*" && " " && "*"))'.
Here is my SQL Code that I am trying to run. Any suggestions?
It works in the Query SQL Editor but not when running it as part of my VBA.
Syntax error (missing operator) in query expression
'(((Len(Trim(tblTempSimNetResultData.STUDENTID)))<>9)) or (((tblTempSimNetResultData.STUDENTID) Like "*" && " " && "*"))'.
Here is my SQL Code that I am trying to run. Any suggestions?
Code:
strCheckStudentIDSQL = "SELECT tblTempSimNetResultData.STUDENTID,
tblTempSimNetResultData.SCORE, tblTempSimNetResultData.[EXAM DATE],
tblTempSimNetResultData.[LAST NAME], tblTempSimNetResultData.[FIRST NAME]
FROM tblTempSimNetResultData
WHERE (((Len(Trim(tblTempSimNetResultData.STUDENTID)))<>9))
Or (((tblTempSimNetResultData.STUDENTID) Like ""*"" && "" "" && ""*""));"
It works in the Query SQL Editor but not when running it as part of my VBA.