beaucoup plus simple
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 SELECT client, Sum(IIf([année]=[an]-1,[ca],0)) AS [N-1], Sum(IIf([année]=[an],[ca],0)) AS N, Sum(IIf([année]=[an],[ca],0)-IIf([année]=[an]-1,[ca],0)) AS ecart FROM matable WHERE année=[an] Or année=[an]-1 GROUP BY client;
Partager