1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
'Recherche des personnes correspondantes aux critères
S1 = "SELECT T_FORM.Nom_Form, T_REL_PERS_FORM.Ddeb_Form, T_REL_PERS_FORM.Dfin_Form, T_REL_PERS_FORM.Vali_Form, T_PERSONNEL.Nom_Pers, T_UNITE.Abre_Unit, T_FORM.Code_Form "
S2 = "FROM T_UNITE INNER JOIN ((T_PERSONNEL INNER JOIN (T_FORM INNER JOIN T_REL_PERS_FORM ON T_OPEX.Code_Form=T_REL_PERS_FORM.Code_Form) ON T_PERSONNEL.Code_Pers=T_REL_PERS_FORM.Code_Pers) "
S8 = "INNER JOIN T_REL_PERS_UNITE ON T_PERSONNEL.Code_Pers=T_REL_PERS_UNITE.Code_Pers) ON T_UNITE.Code_Unit=T_REL_PERS_UNITE.Code_Unit"
S3 = "WHERE ((T_REL_PERS_FORM.Ddeb_Form Between #" + DateDeb + "# And #" + DateFin + "#)"
S4 = "OR (T_REL_PERS_FORM.Dfin_Form Between #" + DateDeb + "# And #" + DateFin + "#)"
S5 = "OR (T_REL_PERS_FORM.Ddeb_Form < #" + DateDeb + "# AND T_REL_PERS_FORM.Dfin_Form > #" + DateFin + "#))"
S6 = "GROUP BY T_FORM.Nom_Form, T_REL_PERS_FORM.Ddeb_Form, T_REL_PERS_FORM.Dfin_Form, T_REL_PERS_FORM.Vali_Form, T_PERSONNEL.Nom_Pers, T_UNITE.Abre_Unit, T_FORM.Code_Form"
S7 = "ORDER BY T_REL_PERS_FORM.Ddeb_Form;"
S = S1 + Chr(32) + S2 + Chr(32) + S8 + Chr(32) + S3 + Chr(32) + S4 + Chr(32) + S5 + Chr(32) + S6 + Chr(32) + S7
Set rs = Bd.OpenRecordset(S)
Set r1 = Bd.OpenRecordset("SELECT * FROM temp_Form")
rs.MoveFirst |
Partager