I'm attempting to query a few named ranges in an Excel workbook using a JET Connection and am receiving an error (Run-time error '-2147217900 (80040e14)': Join expression not supported) when I attempt to add a second condition the one of the joins:
Dim strQuery As String
strQuery = "SELECT mrx.Underlying "
strQuery = strQuery & ",mrx.[exp] "
strQuery = strQuery & ",sum(mrx.[codc]) "
strQuery = strQuery & ",max(mapDt.[Str]) "
strQuery = strQuery & "FROM ((([dataMRX] AS mrx "
strQuery = strQuery & "LEFT OUTER JOIN [mapDt] AS mapDt on "
strQuery = strQuery & "(mrx.[exp] = mapDt.[DtNumeric])) "
strQuery = strQuery & "LEFT OUTER JOIN [mapUdl] AS mapUdl on "
strQuery = strQuery & "(mrx.[Underlying] = mapUdl.[rmpUdl])) "
strQuery = strQuery & "LEFT OUTER JOIN [dataTtm] AS ttm on "
strQuery = strQuery & "(ttm.[Underlying] = mapUdl.[ttmUdl] "
strQuery = strQuery & "AND ttm.[End Month] = mapDt.[Dt])) "
strQuery = strQuery & "GROUP BY mrx.Underlying, mrx.[exp] "
strQuery = strQuery & "ORDER BY mrx.Underlying DESC "
Specifically, if I remove either the first or second join condition in the last left outer join (ttm.[Underlying] = mapUdl.[ttmUdl]
or tmm.[End Month] = mapDt.[Dt])
the query works fine. However with both conditions present, I get an error.
I'm using JET 4.0:
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strFile _
& ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";"