Hello All,

I am new to this forum..

And This is my first post..

I have a SQL query, The query runs successfully in my QC Database.
But when i try to create a VBA with this SQL query, it fails with error " Failed to run the query"

I am clue less... CAn someone please assist????

Here is my Query:

sql = "SELECT * FROM (WITH TempTab as " & _
"(SELECT Level PathDepth, a.AL_ITEM_ID, a.AL_VIEW_ORDER,SYS_CONNECT_BY_PATH(a.AL_DESCRIPTION,'\\') Path " & _
"FROM ALL_LISTS a START WITH a.AL_FATHER_ID is not null CONNECT BY PRIOR a.AL_ITEM_ID = a.AL_FATHER_ID ORDER BY Level DESC) " & _
"SELECT tt.Path,t.TS_Name,t.TS_DESCRIPTION FROM TempTab tt, TEST t WHERE t.TS_SUBJECT=tt.AL_ITEM_ID AND " & _
"SUBSTR(tt.Path,1,10)= '\\\\Subject\\' ORDER BY tt.Path DESC,tt.AL_VIEW_ORDER ASC ) ORDER BY Path , TS_NAME"