I have the following sql query in vb.net and ms access , how do I create a table from the query result ?
`SELECT 'Table1' AS [Table], SUM(a) - SUM(b) AS Result FROM table1 union all union all SELECT 'Table2' AS [Table], SUM(a) - SUM(b) AS Result FROM table2

I have tried the below query . I getting an error - 'an action query cannot be used as a row source'
any help would be appreciated

select * into NewTable from ( SELECT 'Table1' AS [Table], SUM(a) - SUM(b) AS Result FROM table1 union all SELECT 'Table2' AS [Table], SUM(a) - SUM(b) AS Result FROM table2 )

Recommended Answers

All 2 Replies

Member Avatar for LastMitch

I have the following sql query in vb.net and ms access , how do I create a table from the query result ?

@rony001

Beside post the query, you need to explain what you are trying to do?

If you don't explain clearly what you are doing no one will assist you if you don't explain what you are trying to do?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.