1 2 3 4 5 6 7
| TRANSFORM IIf([T_SPerformance]![IDProduits]=1,Sum([T_SPerformance]![QTS])/Sum([T_Performance]![NbFinance]),Sum([T_SPerformance]![QTS])/Sum([T_Performance]![NbUniteLivre])) AS primeMoyenne
SELECT T_Detaillant.IDDetaillant, T_Detaillant.NomDetaillant, T_Performance.IDPersonnel, T_Performance.IDTypeTransaction, T_SPerformance.IDProduits, T_SPerformance.IDSProduits
FROM T_Detaillant INNER JOIN (T_Performance INNER JOIN T_SPerformance ON T_Performance.IDPerformance = T_SPerformance.IDPerformance) ON T_Detaillant.IDDetaillant = T_Performance.IDDetaillant
WHERE (((T_Performance.PerformanceDate) Between Format(RecupDate(1),"""yyyy""/mm/""dd""") And Format(RecupDate(2),"""yyyy""/mm/""dd""") Or (T_Performance.PerformanceDate) Between Format(RecupDate(3),"""yyyy""/mm/""dd""") And Format(RecupDate(4),"""yyyy""/mm/""dd""")))
GROUP BY T_Detaillant.IDDetaillant, T_Detaillant.NomDetaillant, T_Performance.IDPersonnel, T_Performance.IDTypeTransaction, T_SPerformance.IDProduits, T_SPerformance.IDSProduits
ORDER BY T_SPerformance.IDProduits, T_SPerformance.IDSProduits
PIVOT Format([PerformanceDate],"yyyy"); |
Partager