View Full Version : Symtax Error missing operator ?


justchillin
06-26-2006, 01:12 AM
Hi, can anyone help ? I have 2 tables 1 called orderforminput and another called customerdetails. If i run the following sql statment on the orderforminput table it works just great.


"SELECT orderforminput.* FROM orderforminput " & _
"WHERE orderforminput.[Customer] " & strCustomer & _
strCustomerRefCondition & "orderforminput.[Customer Ref] " & strCustomerRef & _
strDoorNumCondition & "orderforminput.[Door Num] " & strDoorNum & ";"

With this code i am trying to retrieve customer name and address from the second table and conbine the results in a query called invoicequery. I keep getting syntax error in query missin operator in query expression. I am new to access and sql can any one shed some lite PLEASE

"SELECT orderforminput.*, CustomerDetails.* FROM orderforminput INNER JOIN CustomerDetails ON orderforminput.Customer = CustomerDetails.Company" & _
"WHERE orderforminput.[Customer] " & strCustomer & _
strCustomerRefCondition & "orderforminput.[Customer Ref] " & strCustomerRef & _
strDoorNumCondition & "orderforminput.[Door Num] " & strDoorNum & ";"

neileg
06-27-2006, 05:48 AM
There's no operator in your WHERE clause. This clause needs to evaluate to true or false, so so you need an equals or a greater than or something.

Why don't you do this query in the query design grid? Much easier than writing SQL. I dont understand why you are building this in text, either.

justchillin
06-27-2006, 02:56 PM
Thanks for your responce Neil, i cracked it this morning, i only posted part of the code maybe i should have posted all of it anyway I changed this

FROM orderforminput INNER JOIN CustomerDetails ON orderforminput.Customer = CustomerDetails.Company" &

to this

FROM orderforminput INNER JOIN CustomerDetails ON orderforminput.[Customer ]= CustomerDetails.[Company]" &

and it does the job just fine. Thanks again for takin the time to reply

Kevin:

neileg
06-28-2006, 01:51 AM
Have you really got a trailing space on [Customer ]?

justchillin
06-28-2006, 01:07 PM
Sorry Neil thats a typo