Results 1 to 3 of 3

JOIN three tables using ADO and JET

Threaded View

PingPing JOIN three tables using ADO... 12-14-2010, 07:38 AM
romperstomper Re: JOIN three tables using... 12-14-2010, 10:19 AM
watersev Re: JOIN three tables using... 12-14-2010, 11:49 AM
  1. #1
    Forum Contributor PingPing's Avatar
    Join Date
    02-19-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    158

    JOIN three tables using ADO and JET

    I'm trying to join three tables (each table being a separate worksheet in the same workbook) into a single recordset using the following SQL command:
    strSQL = "SELECT * FROM [DD$] AS dd " & _
    "INNER JOIN [MD$] AS md ON md.[Bberg ID] = MID(dd.[Bfile Underlying],5,LEN(dd.[Bfile Underlying])) " & _
    "INNER JOIN [BB$] AS bb  ON bb.[BBergID]   = MID(dd.[Bfile Underlying],5,LEN(dd.[Bfile Underlying])) " & _
    "WHERE dd.[Swap Type] = 'CDS'"
    However, I keep getting a syntax error saying there is a 'missing operator' in the query.

    My connection string is:
    strConnect = _
    "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & strFile & ";" & _
    "Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";"
    where strFile is the full path for the workbook.

    Does JET support JOINing more than two tables?
    Does anyone know what's wrong with my query?

    Cheers
    Last edited by romperstomper; 12-14-2010 at 10:18 AM. Reason: add tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1