Function T_graph(cbx As Integer, deb As Long, fin As Long)
Dim Rq As Variant
Rq = Array("`Formation`,`Lieux d'affectation`,`P_stagiaire`&' '&`N_stagiaire`", _
"`Lieux d'affectation`,`Formation`,`P_stagiaire`&' '&`N_stagiaire`", _
"`P_stagiaire`&' '&`N_stagiaire`,`Formation`,`Lieux d'affectation`")
Req = "SELECT `Id`," & Rq(cbx) & _
" ,`P_stagiaire`&' '&`N_stagiaire` AS Nom,`Début`,`Fin`,`Etat`" & _
" ,`Institut de formation`,`Année de formation` " & _
" FROM [Data$A:J] " & _
" WHERE (NOT (`Fin` < " & deb & " OR `Début` > " & fin & "))" & _
" AND ISNULL (`Etat`) " & _
" ORDER BY `Id`"
' " ORDER BY " & Rq(cbx) & ", `N_stagiaire`"
' ou" ORDER BY `Début"
Connect_xls ThisWorkbook.FullName
T_graph = Select_Db(Req, 0)
Close_Cnx
End Function