1

I'm having trouble with a query in MSAccess. The code is shown below:

SELECT CustomerId, FirstName, Surname, DateOfBirth, WorkoutId, Name, Description
   FROM Customer 
   INNER JOIN (Registration INNER JOIN TrainingProgram (INNER JOIN WorkOutPlan)) 
   ON Customer.CustomerId = Registration.CustomerId 
   ON Registration.CustomerId = TrainingProgram.CustomerId 
   ON TrainingProgram.WorkId = WorkOutPlan.WorkId
      WHERE DateOfBirth > #01/01/83#;

The database has been created for a fictional gym.

The aim of the query is to show what workout plan members are on with a date of birth greater that 01/01/83. The information the query is selecting is coming from 3 Tables. Customer, TrainingProgram and WorkOutPlan. The other table 'Registration' links the Customer Table and Training Program table with 'CustomerId'

The query is producing a syntax error and highlighting the bracket '"("INNER JOIN WorkOutPlan))'. I cant see any issues with the code but maybe I have made a mistake along the way?

Your help would be much appreciated.

4

1 に答える 1

3

適切にブラケット

SELECT CustomerId, FirstName, Surname, DateOfBirth, WorkoutId, Name, Description
FROM (Customer 
INNER JOIN (Registration
            INNER JOIN (TrainingProgram
                        INNER JOIN WorkOutPlan 
                                   ON Customer.CustomerId = Registration.CustomerId )
                        ON Registration.CustomerId = TrainingProgram.CustomerId )
            ON TrainingProgram.WorkId = WorkOutPlan.WorkId)
WHERE DateOfBirth > #01/01/83#;
于 2013-04-24T10:15:08.893 に答える