UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Adodb Subquery Error    
 
   
Sailor
post Feb 3 2017, 12:14 AM
Post#1



Posts: 95
Joined: 14-December 16



I am using ADODB and VB6 , the following query is works fine with open method
CODE
"SELECT sub.want-Count(table1.job) AS totals,Count(table1.job) as totx,sub.JobName AS jobs " & _
            "FROM table1 " & _
            "RIGHT JOIN sub ON sub.JobName=table1.job " & _
            "GROUP BY sub.JobName , sub.want; "


but when trying to use a sub query as follows the error occurs :
CODE
"SELECT sub.want-Count(countx.job) AS totals,Count(countx.job) as totx,totx/sub.want as ratios, sub.JobName AS jobs " & _
                                "FROM (SELECT DISTINCT names,job,employ_type,in_rest FROM table1 WHERE employ_type='full' and in_rest=0) AS countx " & _
                                "RIGHT JOIN sub ON sub.JobName=countx.job " & _
                                "GROUP BY sub.JobName , sub.want; "


the error message is :

run-time error '2147467259 (80004005)':
method 'open' of object '_Recordset' failed
what's the wrong frown.gif
Go to the top of the page
 

Posts in this topic



Custom Search


RSSSearch   Top   Lo-Fi    11th December 2019 - 01:02 AM