var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Left Joins with Multiple Conditions in VBA
I am trying to run a query in Excel VBA. The query has a left join with a two conditions -- every time I run it excel crashes. If I remove the brackets enclosing the two conditions, the query fails.
The query itself is correct because if I run it directly in Oracle it works. Also I can run it thru excel via Date->Import External Data but not thru VBA.
Also if I restrict myself to one condition instead of two it works thru VBA.
Any one have any insights into what the problem could be?? Or any proposed workaround... Thanks in advance.
Dim db As Database
Set db = OpenDatabase("", dbDriverPrompt, False, "ODBC;DSN=FM;")
Query = "select VCI.isec_id, VCI.inst_class, CVL_IDENT_BB.EXT_IDENT, VCI.pl_ccy as CCY " _
& "from V_CONT_INMK VCI " _
& "left join IDENTIFIER CVL_IDENT_BB on (CVL_IDENT_BB.tdp_id = VCI.isec_id and " _
& "CVL_IDENT_BB.ident_type = " & Chr(39) & "BB_TCM" & Chr(39) & ") " _
& "where VCI.inst_class in (" & Chr(39) & "ORD" & Chr(39) & ", " & Chr(39) & "DR" & Chr(39) & ", " & Chr(39) & "CFD" & Chr(39) & ")"
Dim FM As Recordset
Set FM = db.OpenRecordset(Query, dbOpenDynaset, dbSeeChanges, dbReadOnly)
Are you sure Query is getting the correct SQL?
Left Join Problem
Yes. I actually forced the function to return the query and cut and paste it into Oracle and it works!!