Hi,
I would like to sum two or more sub-select queries based on the same table.
Like this
SELECT
(
(SELECT AMOUNT FROM GLOBAL AS SUBGLOBAL WHERE SUBGLOBAL.KEY = GLOBAL.KEY AND DOC = INVOICE)
+
(SELECT AMOUNT FROM GLOBAL AS SUBGLOBAL WHERE SUBGLOBAL.KEY = GLOBAL.KEY AND DOC = CREDITNOTE)
) AS BALANCE
FROM GLOBAL
Here i get a null value
I have tried to SUM ((SELECT ...) + (SELECT ...) FROM ... but i get message cannot aggregate subquery
Your help is appreciated in advance
Cheers
Didier