Question : MS Access - Return multiple results query

I want to return a recordset with multiple 'totals; in it - in MS SQL I would construct a query like:

SELECT 'row' ,
 (SELECT SUM(commission) FROM [transactions] WHERE type=0 OR type=2)  total1
, (SELECT count(*) FROM users) ,(SELECT count(*) FROM transactions WHERE type = 0)  total2
,(SELECT SUM(commission) FROM [transactions] WHERE type=1)  total3

which would return me a single row of data with the 3 total in it but I can't seem to get this to work for MS Access - any clues?

Answer : MS Access - Return multiple results query

Seems Jet doesn't like subqueries when there is no FROM clause in the main query.  Try:
1:
2:
3:
4:
5:
6:
SELECT TOP 1 "row" AS Label,
    (SELECT SUM(commission) FROM [transactions] WHERE type=0 OR type=2) AS SumCommission0or2,
    (SELECT count(*) FROM users) AS UserCount,
    (SELECT count(*) FROM transactions WHERE type = 0) AS TxnCount,
    (SELECT SUM(commission) FROM [transactions] WHERE type=1) AS SumCommission1
FROM [transactions]
Random Solutions  
 
programming4us programming4us