SQL query error

  • Thread starter Thread starter Eva
  • Start date Start date
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?
 
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 Matt,

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

-----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?


.
 
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
 
Back
Top