Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder luigicannavaro's Avatar
    Join Date
    Aug 2007
    Posts
    150
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Question A multiple query

    Hello,

    Once again, I've gotten stumped on a complex query. Basically, we have a DB with 3 tables. Here is the query structure:


    Code:
    rs.open "Select TESTB.Contents From TESTA inner Join TESTC On (TESTC.OrderID = TESTA.IndexID) inner Join testb On (testb.indexid = TESTC.Ex_usoID) Where testa.word like '%"&StrKeyword&"%' ", conn
    The code do not works fine giving the following message:
    Code:
    Syntax error (missing operator) in query expression '(TESTEC.OrderID = TESTEA.IndexID) inner Join testeb On (testeb.indexid = TESTEC.Ex_usoID)'.

    Thanks for any help you can provide

    Luigi

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,561
    Thanks
    80
    Thanked 4,495 Times in 4,459 Posts
    The error message does not match the query you showed.

    The error message says
    Code:
    (TESTEC.OrderID = TESTEA.IndexID)
    whereas the code you showed is
    Code:
    (TESTC.OrderID = TESTA.IndexID)
    So one or the other--your code or the error message--or both are not what you actually have, it would appear.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Regular Coder luigicannavaro's Avatar
    Join Date
    Aug 2007
    Posts
    150
    Thanks
    11
    Thanked 0 Times in 0 Posts
    Hi

    The problem iis not with the spelling words (I have corrected), but the ordem of the fields and comands. I think.

    Luigi

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,561
    Thanks
    80
    Thanked 4,495 Times in 4,459 Posts
    This is an Access DB, yes?

    Try taking the query and running in Access, not from ASP. Sometimes you will get better error diagnostics in Access.

    You could also try this with IMPLICIT joins:
    Code:
    SQL = "Select TESTB.Contents " _
        & " From TESTA, TESTC, TESTB " _
        & " Where TESTC.OrderID = TESTA.IndexID " _
        & " And testb.indexid = TESTC.Ex_usoID " _
        & " And  testa.word like '%" & StrKeyword & "%' "
    rs.Open SQL, conn
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •