Link to home
Start Free TrialLog in
Avatar of RichFrot
RichFrotFlag for United States of America

asked on

SQL syntax error 80040e14

Hi,
I am getting the following syntax error (missing operator) on the following sql statement.  Any ideas?


SQLQuery = "SELECT tblClients.ClientNumber, tblClients.NachaNameControlCode, tblClientsStates.StateId, tblClientsStates.State" _
    & "FROM tblClients INNER JOIN tblClientsStates ON tblClients.ClientNumber = tblClientsStates.ClientNumber" _
    & "WHERE (((tblClientsStates.State)=NJ ));"
    rst.Open SQLQuery, cnn, adOpenKeyset, adLockOptimistic

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RichFrot

ASKER

Thanks -- That was the problem -- Plus I needed ' ' around NJ

Like this
& "WHERE (((tblClientsStates.State)='NJ' )); "
ah.. damn! how can i miss that? ;-)

you're right for above discovery, but the space is still important too, so that the recordset object recognize your sql statement.

cheers