November 7, 2008 at 11:12 am
I am trying to produce the total number of test for 2 types of test and sessions for October. I keep getting Syntax error on join operation.
SELECT Booking.Lesson_CatId, Lesson_Categories.Lesson_Category, Booking.Lesson_Date, Count([Booking.Lesson_CatId]) AS Total_Number_Of_Tests
FROM Lesson_Type INNER JOIN (Session_Information INNER JOIN (Lesson_Categories INNER JOIN Booking ON Session_Information.Booking_Id=Booking.Booking_Id) ON Lesson_Type.Lesson_TypeId = Session_Information.Lesson_TypeId) ON Lesson_Categories.Lesson_CatId = Lesson_Type.Lesson_CatId
WHERE ([Booking].[Lesson_Date]) Between #10/1/2008# And #10/31/2008#;
November 7, 2008 at 11:40 am
Is this the error message you get?
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '#'.
If not then please assist others to assist you by following the suggested posting format described by the link in my signature block.
November 7, 2008 at 12:06 pm
No. It's saying Syntax error on Join operation. I am working with Microsoft Access.
After clicking ok on the syntax error it automatically highlights the (Session_Information Join.
November 7, 2008 at 12:13 pm
It is related to how the parens are used in the joins. Looks like the FROM clause needs to be rewritten.
November 7, 2008 at 12:28 pm
If it's a MS Access, then go to a query tab; draw your query and use the pregenerated SQL statement in your code...
November 7, 2008 at 1:07 pm
I will rewrite it instead in nested select statements and see if it works.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply