Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Multiple-joins rejected by Jet?

Back to Forum: Tech Off
  • User profile image
    W3bbo

    If JET really doesn't like multiple-joins I'm moving this over to MSDE.

    This is the SQL:


    SELECT
    *
    FROM

    Occurences
    INNER JOIN Bookings ON Occurences.ParentBooking = Bookings.[ID]
    INNER JOIN Customers ON Bookings.Customer = Customer.[ID]

    WHERE

    Occurences.[Date] > #2006-01-01# AND Occurences.[Date] < #2006-01-05#

    and JET throws this error:

    Syntax error (missing operator) in query expression 'Occurences.Parentbooking = Bookings.[ID] INNER JOIN  Customers ON Bookigns.Customer = Customer.[ID]

    The error goes away once I remove the second INNER JOIN line.

    Any ideas?

  • User profile image
    cpod

    Doesn't JET want it to look something like this?

    SELECT * FROM (Occurences INNER JOIN Bookings ON Occurences.ParentBooking = Bookings.[ID])
    INNER JOIN Customers ON Bookings.Customer = Customers.[ID]
    WHERE Occurences.[Date] > #2006-01-01# AND Occurences.[Date] < #2006-01-05#

  • User profile image
    billh

    Oh, Jet can handle multiple joins. I was handed a bunch of queries a ways back where a typical query contained 8-10 tables (some descriptor tables) and usually between 10-20 individual joins. The queries were originally done up in Access, but I later ported them to a different tool for speed reasons (the way Jet does inner joins gives me a headache, btw).

    cpod wrote:
    Doesn't JET want it to look something like this?

    SELECT * FROM (Occurences INNER JOIN Bookings ON Occurences.ParentBooking = Bookings.[ID])
    INNER JOIN Customers ON Bookings.Customer = Customers.[ID]
    WHERE Occurences.[Date] > #2006-01-01# AND Occurences.[Date] < #2006-01-05#

    What he said. Are the brackets even needed, though?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.