rony_78 Posted March 4, 2014 Share Posted March 4, 2014 I'm running this query on an MDB file from vb.Net, ;select * into NewTablefrom ( SELECT 'Table1' AS [Table], SUM(a) - SUM( AS Result FROM table1 union all SELECT 'Table2' AS [Table], SUM(a) - SUM( AS Result FROM table2) The inner SELECT works fine but when wrapped in the outer SELECT, I get the error "An action query cannot be used as a row source."Please tell me how can I fix this Link to comment Share on other sites More sharing options...
justsomeguy Posted March 5, 2014 Share Posted March 5, 2014 It sounds like you're trying to use that query as a data source for something like a combo box or another component, and it doesn't allow you to use a query that creates a new table as a data source. Link to comment Share on other sites More sharing options...
rony_78 Posted March 6, 2014 Author Share Posted March 6, 2014 SELECT "Table1" AS Table, SUM(a) - SUM( AS Result FROM table1UNIONSELECT "Table2", SUM(a) - SUM( FROM table2UNIONSELECT "Table3", SUM(a) - SUM( FROM table3 It gives me this output table | result-------|-------- I would like to know how do I update the below table with "result" column from output table?name | table | result------|-------|--------I have tried to save the output table in a new table then reference the new table to update the other table. I get this Error. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 6, 2014 Share Posted March 6, 2014 How are you running the query? If you have an existing table then you can use an insert..select query to add rows to the table from a select query. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now