Missing Operator Error in Access

C

CJM

I'm trying to install a freebie app downloaded from the web.

Its based on an Access Db, and I'm getting the a missing operator error for
the following SQL:

SELECT COUNT(DatabaseUsers.database_id) As Total FROM Users INNER JOIN
DatabaseUsers ON Users.username = DatabaseUsers.user_id INNER JOIN Databases
ON DatabaseUsers.database_id = Databases.ID WHERE Users.username = ''

I've imported the DB in to SQL server to test in Query Analyser, and this
SQL works fine...

Any ideas?

TIA

Chris
 
K

Ken Schaefer

You need to use () around the joins in Access.

SELECT
COUNT(DatabaseUsers.database_id) As Total
FROM
(
(
Users
INNER JOIN
DatabaseUsers
)
INNER JOIN
Databases
ON
DatabaseUsers.database_id = Databases.ID
)
ON
Users.username = DatabaseUsers.user_id
WHERE
Users.username = ''

(I think that's correct - best bet is to build the Query in the Access Query
builder - you'll see how Access puts in the brackets for you).

Cheers
Ken



: I'm trying to install a freebie app downloaded from the web.
:
: Its based on an Access Db, and I'm getting the a missing operator error
for
: the following SQL:
:
: SELECT COUNT(DatabaseUsers.database_id) As Total FROM Users INNER JOIN
: DatabaseUsers ON Users.username = DatabaseUsers.user_id INNER JOIN
Databases
: ON DatabaseUsers.database_id = Databases.ID WHERE Users.username = ''
:
: I've imported the DB in to SQL server to test in Query Analyser, and this
: SQL works fine...
:
: Any ideas?
:
: TIA
:
: Chris
:
:
 

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