1 2 3 4 5 6
| sSQL = "SELECT [tbl-Ressources Humaines].[Effectif N], [tbl-Ressources Humaines].[Effectif P], Sum([tbl-Ressources Humaines].[H-Supp]) AS [SHS]"
sSQL = sSQL & " FROM [tbl-Groupes] INNER JOIN ([tbl-En tête] INNER JOIN [tbl-Ressources Humaines] ON [tbl-En tête].[N° OZP] = [tbl-Ressources Humaines].[N° OZP]) ON [tbl-Groupes].[N° Groupe] = [tbl-En tête].[N° Groupe]"
sSQL = sSQL & " GROUP BY [tbl-En tête].OZP, [tbl-En tête].Semaine, [tbl-En tête].Equipe, [tbl-Groupes].Groupe, [tbl-Ressources Humaines].[Effectif N], [tbl-Ressources Humaines].[Effectif P]"
sSQL = sSQL & " HAVING ((([tbl-En tête].OZP)=[formulaires]![frm-selection-heure]![OZP]) AND (([tbl-En tête].Semaine)=[formulaires]![frm-selection-heure]![Semaine]) AND (([tbl-En tête].Equipe)=[formulaires]![frm-selection-heure]![Equipe]) AND (([tbl-Groupes].Groupe)=[formulaires]![frm-selection-heure]![Groupe])AND ((Sum([tbl-Ressources Humaines].[H-Supp]))<>0));"
Set myrst = db.OpenRecordset(sSQL) |
Partager