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 )