SQL query error

E

Eva

Hi,

I am trying to add a OleDataAdapter to my form so i can
connect my datagrid to my access XP database. When i am
propted in the configuration stage to enter a sql query,
i use the query builder to create the following query:

SELECT [Caravan details].Beds, [Caravan details].[Caravan
Inv No], [Caravan details].[Caravan Model], [Caravan
details].[Cost/day], [Caravan details].Length, [Caravan
details].[No on site] FROM [Caravan booking] INNER JOIN
[Caravan details] ON [Caravan booking].[Caravan Inv No] =
[Caravan details].[Caravan Inv No] INNER JOIN Client ON
[Caravan booking].[Booking No] = Client.[Booking No]

the problem is that i keep getting the following error
message. i dont understand why there is a syntax error
when the code has been generated by the query builder


Generated select statement (it has an exclamation mark
next to it)
Syntax error (missing operator) in query
expression '[Caravan booking].[Caravan Inv No] = [Caravan
details].[Caravan Inv No] INNER JOIN Client ON [Caravan
booking].[Booking No] = Client.[Booking No]'.

can anyone help me resolve this?
 
M

Matt Burland

I'm completely guessing here, but I had strange syntax errors happen when I
have fields with names such as "Date" or "Value" because they mean something
special in an SQL command, looking at your select statement, I'm wondering
if it isn't objecting to "Length"? Try [Length].
 
E

Eva

Hi Matt,

I tried this but i still seem to be getting the same
error message :blush:(

-----Original Message-----
I'm completely guessing here, but I had strange syntax errors happen when I
have fields with names such as "Date" or "Value" because they mean something
special in an SQL command, looking at your select statement, I'm wondering
if it isn't objecting to "Length"? Try [Length].

Hi,

I am trying to add a OleDataAdapter to my form so i can
connect my datagrid to my access XP database. When i am
propted in the configuration stage to enter a sql query,
i use the query builder to create the following query:

SELECT [Caravan details].Beds, [Caravan details]. [Caravan
Inv No], [Caravan details].[Caravan Model], [Caravan
details].[Cost/day], [Caravan details].Length, [Caravan
details].[No on site] FROM [Caravan booking] INNER JOIN
[Caravan details] ON [Caravan booking].[Caravan Inv No] =
[Caravan details].[Caravan Inv No] INNER JOIN Client ON
[Caravan booking].[Booking No] = Client.[Booking No]

the problem is that i keep getting the following error
message. i dont understand why there is a syntax error
when the code has been generated by the query builder


Generated select statement (it has an exclamation mark
next to it)
Syntax error (missing operator) in query
expression '[Caravan booking].[Caravan Inv No] = [Caravan
details].[Caravan Inv No] INNER JOIN Client ON [Caravan
booking].[Booking No] = Client.[Booking No]'.

can anyone help me resolve this?


.
 
I

IbrahimMalluf

Hello Eva

Is this the entire query or is there a Where clause?

Heh, shure glad I didn't spec out that database. All those spaces in the
column and entity names can only bring on problems.

Ibrahim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SQL query help 4
Plz help. SQL help needed. 1
###Query help needed 2
Need help writing a query 1
DataBinding 2
error message. 1
query not working 1
Creating an advanced search from a form 4

Top