Reference 'CAN' not supported (reference to group function)
Bonjour,
Je rencontre un problème avec une requête, un problème dont je ne trouve pas la solution lors de l’exécution de la requête, voici l'erreur qui apparaît :
Citation:
Reference 'CAN' not supported (reference to group function)
Voici ma requête :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| SELECT
T1.ITMREF_0 as CODART,
T1.ITMDES1_0 as ARTDES,
round(sum(T1.AMTNOTLIN_0)) as CAN,
(SELECT round(sum(T2.AMTNOTLIN_0)) FROM sinvoiced T2 WHERE T2.SALFCY_0 = T1.SALFCY_0
AND year(T2.INVDAT_0) = year(T2.INVDAT_0)-1) as CAN_1,
(SELECT (CAN-CAN_1)) as ECART,
(SELECT (round(sum(T1.AMTNOTLIN_0*T1.SNS_0)))) as CAAPREM,
(round(sum(T1.PFM_0*T1.SNS_0*T1.QTY_0))) as MARGE,
(round(sum(T1.AMTATILIN_0))) as MNTTTC
FROM sinvoiced T1
WHERE T1.SALFCY_0 = 'F11'
AND year(T1.INVDAT_0) = 2011 |
si quelqu'un peut m'aider, ce serait cool ;)
MErci par avance