Inner joins and table names containing spaces - a problem?

G

GerryS

I am using the format select ... FROM ListofTests INNER JOIN ( SampleLog
INNER JOIN SampleTestXref ON SampleTestXref.LabRefNo = SampleLog.LabRefNo) ON
ListofTests.ID = SampleTestXref.TestID
WHERE SampleTestXref.External<>False;

The tables SampleLog, SampleTestXref and ListofTests are actually links to
[Sample Log], [Sample Test Xref] etc but I cannot get this query to work with
square brackets let alone spaces. I am using this format because I want to
extend the query with an outer join and Access doesn't appear to support the
(*) symbol used in Oracle for the alternative SQL format. I don't want to
use "Auto Rename" because I have had problems in the past which have been
laid at the door of that process. I don't want to rename manually because
there are piles of VBA behind the forms and I don't want to keep the links
because 2 of these tables are quite large and it seems un-neccessarily
complex and inefficient.

Two questions then:-
1) Am I correct that square brackets won't work in an inner join to quote a
table name containing spaces?
2) If so, is there a way around the problem without resorting to renaming
or links?
 
B

Baz

GerryS said:
Two questions then:-
1) Am I correct that square brackets won't work in an inner join to quote
a
table name containing spaces?

You are not correct, they will work fine.
2) If so, is there a way around the problem without resorting to renaming
or links?

Please describe what happens when you use the real (bracketed) table names,
as well as posting the *exact* SQL you tried. I'm sure someone will be able
to tell you what the problem is.
 
G

GerryS

Obviously finger problems: I've substituted back the original table names
with brackets and the query now works! No idea what the original problem
was. Thanks for the help & sorry for the waste of time
 
B

Baz

No problem, glad you got it working.

GerryS said:
Obviously finger problems: I've substituted back the original table names
with brackets and the query now works! No idea what the original problem
was. Thanks for the help & sorry for the waste of time
 

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

Top