Bonjour,

J'ai une Table APPEL avec NO_APPEL / ID_OPEN / ID_CLOSE / ID_INT / NBJ

Dans mon rapport j'ai un paramètre multiple sur ID.

Si un des ID (OPEN CLOSE or INT) correspond à un des ID du paramètre je prends l'enregistrement

Voici le résultat de ma requête avec comme paramètre XC + LO

NO_APPEL OPEN INT CLOSE NBJ
INC00001 MA XC XC 3
INC00002 XC XC XC 2
INC00003 XC XC LO 2

je voudrais afficher :

NOM OPEN INT CLOSE NBJ
XC 2 3 2 5
LO 0 0 1 2


XC et LO ne sont que des exemples de differents ID...

Mon SQL du Dataset1

Code SQL : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
SELECT AP.IDT_APPEL, ap.D_APPEL,ap.d_creation, E.L_EQUIPE,  
AP.NB_JHREELRFC, AP.L_TITRENEWS, AP.C_UTIL_INT, AP.C_UTIL_ASS,
AP.C_UTIL_DEM, AP.C_UTIL_CLOS, AP.D_CLOTTECH, CONCAT(u.N_UTIL,' ',u.PRE_UTIL) AS INTERVENANT, CONCAT(U2.N_UTIL,' ',U2.PRE_UTIL) AS DEMANDEUR,
CONCAT(U3.N_UTIL,' ',U3.PRE_UTIL) AS CREATEUR, CONCAT(U4.N_UTIL,' ',U4.PRE_UTIL) AS CLOTUREUR, CONCAT(U5.N_UTIL,' ',U5.PRE_UTIL) AS APP
 
FROM APPEL AP
LEFT JOIN EQUIPE E ON E.C_EQUIPE = AP.C_EQUIPE
LEFT JOIN UTILISATEUR U on AP.C_UTIL_INT = U.C_UTIL
LEFT JOIN UTILISATEUR U2 on AP.C_UTIL_DEM = U2.C_UTIL
LEFT JOIN UTILISATEUR U3 on AP.C_UTIL_ASS = U3.C_UTIL
LEFT JOIN UTILISATEUR U4 on AP.C_UTIL_CLOS = U4.C_UTIL
LEFT JOIN UTILISATEUR U5 on AP.C_UTIL_APP = U5.C_UTIL
 
WHERE ap.d_creation > '31-12-2015'
and  ap.C_NATURE = 'RFC'
 
and ((@Année = Year(ap.d_CLOTTECH)
and (@Mois > 12 or @Mois = Month(ap.d_CLOTTECH))
and (@Jour > 31 or @Jour = Day(ap.d_CLOTTECH)))
OR
(@Année = Year(ap.d_creation)
and (@Mois > 12 or @Mois = Month(ap.d_creation))
and (@Jour > 31 or @Jour = Day(ap.d_creation))))
 
and (U.C_UTIL IN(@Utilisateur) OR U4.C_UTIL IN(@Utilisateur) OR U3.C_UTIL IN(@Utilisateur))

ET le Dataset2pour la liste paramètres multiple Utilisateur :

Code SQL : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
SELECT C_UTIL, C_EQUIPEPRIV, N_UTIL, PRE_UTIL
FROM UTILISATEUR WHERE (C_EQUIPEPRIV = 'CDS' OR C_EQUIPEPRIV = 'AU_SP') AND PRE_UTIL <> 'iws' AND N_UTIL <> 'ADMIN' AND PRE_UTIL not like '%Référent%' AND N_UTIL not like '%ATTENTE%' AND C_ISIPARC like '%1%' AND (year(D_ARCHIVE) > '2016' OR D_ARCHIVE IS NULL) ORDER BY C_EQUIPEPRIV ASC

mais je ne vois pas comment faire le regroupement...

Merci à tous