Symtax Error missing operator ?

justchillin

Registered User.
Local time
Today, 23:48
Joined
Jun 19, 2006
Messages
13
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 & ";"
 
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.
 
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:
 
Have you really got a trailing space on [Customer ]?
 

Users who are viewing this thread

Back
Top Bottom