1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| select * from (
SELECT iif(AFFAIRES.[Transaction aboutie]=-1,"Transactions abouties") AS Libellé, Count(AFFAIRES.[Transaction aboutie]) AS Volume, Count(AFFAIRES.[Transaction aboutie])/(SELECT Count(AFFAIRES.Réfaffaires) AS CompteDeRéfaffaires FROM AFFAIRES) AS Taux, Sum(AFFAIRES.[Montant honoraires HT]) AS CA
FROM AFFAIRES
WHERE (((AFFAIRES.[Transaction aboutie])=True))
GROUP BY AFFAIRES.[Transaction aboutie];
UNION
SELECT iif(AFFAIRES.[Transaction en cours]=-1,"Transactions en cours") AS Libellé, Count(AFFAIRES.[Transaction en cours]) AS Volume, Count(AFFAIRES.[Transaction aboutie])/(SELECT Count(AFFAIRES.Réfaffaires) AS CompteDeRéfaffaires FROM AFFAIRES) AS Taux, Sum(AFFAIRES.[Montant honoraires HT]) AS CA
FROM AFFAIRES
WHERE (((AFFAIRES.[Transaction en cours])=True))
GROUP BY AFFAIRES.[Transaction en cours];
UNION
SELECT iif(AFFAIRES.[Transaction avortée]=-1,"Transactions avortées") AS Libellé, Count(AFFAIRES.[Transaction avortée]) AS Volume, Count(AFFAIRES.[Transaction aboutie])/(SELECT Count(AFFAIRES.Réfaffaires) AS CompteDeRéfaffaires FROM AFFAIRES) AS Taux, Sum(AFFAIRES.[Montant honoraires HT]) AS CA
FROM AFFAIRES
WHERE (((AFFAIRES.[Transaction avortée])=True))
GROUP BY AFFAIRES.[Transaction avortée];
) order by iif([Transaction aboutie],1,iif([Transactions avortée],2,iif([Transaction en cours],3,null))) |
Partager