{"text_format":"1","workbook":"xlsx","n_sheets":2,"sheets":["SQL Results","SQL Statement"],"not_rendered":{"charts":0,"images":0,"macros":1,"external_links":0,"defined_names":0,"comments":0,"pivot_tables":0},"unopened":[],"bounds":{"document_bytes":16777216,"sheet_cells":100000,"rows_first":2000,"rows_last":500,"rows_between":2000,"halvings":0,"cell_chars":16384,"cell_head_chars":4096},"cells_cut":0,"cells_raw":0,"read":"whole","date_system":"1900"}

{"sheet":"SQL Results","index":0,"n_rows":54,"n_cols":9,"rows_kept":54,"cut":false,"hidden":false,"merged":[]}
["","SQ_MATRICULE","NOM","PRENOM","FONCTION","DESCRIPTION","DT_DEBUT","DT_FIN","DT_DEPART_SQ"]
[1,"SQ10003","Boulanger","Jonathan","032","Agt Liais. Autoch 02","2011-03-11","2012-03-14"]
[2,"SQ10563","Desbiens","Dany","433","Agt Liai. Ct Autoch","2013-04-01"]
[3,"SQ10571","Larouche","Frédéric","032","Agt Liais. Autoch 02","2015-10-10"]
[4,"SQ10571","Larouche","Frédéric","032","Agt Liais. Autoch 02","2012-02-18","2014-05-20"]
[5,"SQ10623","Gervais","Richard","433","Agt Liai. Ct Autoch","2016-05-17","2016-12-16"]
[6,"SQ10624","Côté","François","032","Agt Liais. Autoch 02","2010-08-01","2011-08-14"]
[7,"SQ11094","Frenette","Daniel","032","Agt Liais. Autoch 02","2007-09-25","2007-09-28","2014-02-14"]
[8,"SQ11094","Frenette","Daniel","032","Agt Liais. Autoch 02","2007-09-22","2007-09-23","2014-02-14"]
[9,"SQ11094","Frenette","Daniel","032","Agt Liais. Autoch 02","2007-04-01","2007-09-19","2014-02-14"]
[10,"SQ11433","Bouvier","Julie","032","Agt Liais. Autoch 02","2016-12-21"]
[11,"SQ11589","Boulanger","Geoffroy","032","Agt Liais. Autoch 02","2008-01-11","2012-02-27"]
[12,"SQ11589","Boulanger","Geoffroy","032","Agt Liais. Autoch 02","2007-12-01","2008-01-09"]
[13,"SQ11866","Bélisle","Guillaume","032","Agt Liais. Autoch 02","2010-05-01"]
[14,"SQ12064","Larouche","Dany","032","Agt Liais. Autoch 02","2008-08-15","2010-11-30"]
[15,"SQ12400","Courteau","Chantal","032","Agt Liais. Autoch 02","2017-05-01"]
[16,"SQ12589","Maltais","Guillaume","433","Agt Liai. Ct Autoch","2013-08-15"]
[17,"SQ12873","McBride","Matthew","032","Agt Liais. Autoch 02","2013-06-01","2014-10-27"]
[18,"SQ6669","Beaudry","Daniel","032","Agt Liais. Autoch 02","2003-04-06","2003-04-06","2006-07-06"]
[19,"SQ6669","Beaudry","Daniel","032","Agt Liais. Autoch 02","2002-06-07","2002-09-08","2006-07-06"]
[20,"SQ6669","Beaudry","Daniel","032","Agt Liais. Autoch 02","1994-07-08","2001-04-22","2006-07-06"]
[21,"SQ6760","Turnbull","Ian","032","Agt Liais. Autoch 02","2000-12-01","2003-05-30","2003-05-30"]
[22,"SQ7049","Bremer","Louis","032","Agt Liais. Autoch 02","2003-08-11","2009-01-17","2009-01-17"]
[23,"SQ7049","Bremer","Louis","032","Agt Liais. Autoch 02","2002-07-02","2003-08-09","2009-01-17"]
[24,"SQ7049","Bremer","Louis","032","Agt Liais. Autoch 02","2002-06-17","2002-06-29","2009-01-17"]
[25,"SQ7049","Bremer","Louis","032","Agt Liais. Autoch 02","2002-05-25","2002-06-14","2009-01-17"]
[26,"SQ7120","Babin","Gilles","032","Agt Liais. Autoch 02","2007-06-04","2012-04-30","2015-11-20"]
[27,"SQ7282","Delisle","Réjean","032","Agt Liais. Autoch 02","2001-09-17","2002-05-23","2009-06-19"]
[28,"SQ7407","Cadieux","Daniel","032","Agt Liais. Autoch 02","2005-11-12","2008-02-07","2016-03-31"]
[29,"SQ7418","Savage","Daniel","032","Agt Liais. Autoch 02","2003-02-24","2005-04-21","2008-09-19"]
[30,"SQ7658","Bibeau","Raymond","032","Agt Liais. Autoch 02","1998-01-26","2001-01-31"]
[31,"SQ7757","Hébert","Alain","433","Agt Liai. Ct Autoch","2013-03-11"]
[32,"SQ8394","Hétu","Louis-François","032","Agt Liais. Autoch 02","1998-02-16","2001-06-30"]
[33,"SQ8551","Lacombe","Claude","433","Agt Liai. Ct Autoch","2013-08-13"]
[34,"SQ8563","Vicaire","Jean","032","Agt Liais. Autoch 02","2006-03-30","2016-01-17","2016-01-17"]
[35,"SQ8643","Roussel","Germain","032","Agt Liais. Autoch 02","1999-10-04","2001-08-31","2012-03-30"]
[36,"SQ8644","Boutin","Carole","032","Agt Liais. Autoch 02","2005-07-25","2007-07-01","2015-03-31"]
[37,"SQ8663","Landry","Jean","032","Agt Liais. Autoch 02","2015-11-10","2015-12-12"]
[38,"SQ8930","Simoneau","Sylvie","032","Agt Liais. Autoch 02","2016-05-24","2017-03-21","2017-03-21"]
[39,"SQ9001","Leblanc","Karina","032","Agt Liais. Autoch 02","2014-10-27","2015-10-16"]
[40,"SQ9008","Leduc","Paul","032","Agt Liais. Autoch 02","1999-10-11","2002-03-17"]
[41,"SQ9079","Couture","René","032","Agt Liais. Autoch 02","2001-07-01","2002-06-20"]
[42,"SQ9113","Rouillard","Ghislain","032","Agt Liais. Autoch 02","2002-02-04","2007-04-29"]
[43,"SQ9128","Medeiros","Carlos","032","Agt Liais. Autoch 02","2009-06-20","2010-10-02"]
[44,"SQ9128","Medeiros","Carlos","032","Agt Liais. Autoch 02","2008-11-30","2009-05-28"]
[45,"SQ9315","Michaud","Jean-Marc","433","Agt Liai. Ct Autoch","2013-03-11","2014-10-02","2014-10-02"]
[46,"SQ9415","Michaud","Éric","032","Agt Liais. Autoch 02","2011-12-10","2013-09-08"]
[47,"SQ9415","Michaud","Éric","032","Agt Liais. Autoch 02","2010-10-26","2011-07-25"]
[48,"SQ9415","Michaud","Éric","032","Agt Liais. Autoch 02","2007-09-25","2009-12-30"]
[49,"SQ9415","Michaud","Éric","032","Agt Liais. Autoch 02","2007-09-01","2007-09-23"]
[50,"SQ9496","Labrie","Érick","032","Agt Liais. Autoch 02","2003-01-01","2007-03-29","2016-10-25"]
[51,"SQ9645","Talbot","Marc","032","Agt Liais. Autoch 02","2011-09-04","2013-03-31"]
[52,"SQ9707","Jean","Israël","032","Agt Liais. Autoch 02","2013-10-06"]
[53,"SQ9953","Bergeron","David","433","Agt Liai. Ct Autoch","2017-04-01","2017-04-02"]

{"sheet":"SQL Statement","index":1,"n_rows":1,"n_cols":1,"rows_kept":1,"cut":false,"hidden":false,"merged":[]}
["select emp.sq_matricule, emp.nom, emp.prenom,\n       fonct.fnctn_code fonction, fct.description,\n       fonct.dt_debut,\n       decode(fonct.dt_debut_suiv, null, emp.dt_depart_sq, fonct.dt_debut_suiv - 1) dt_fin,\n       emp.dt_depart_sq\n  from\n   --------------------------------------------------------------------------\n   (select mouv.emply_no_employe, mouv.dt_debut, mouv.dt_fin, mouv.fnctn_code,\n           --lead(mouv.dt_debut) OVER(PARTITION BY mouv.emply_no_employe ORDER BY mouv.dt_debut desc) AS dt_debut_prec,\n           --lead(mouv.dt_fin) OVER(PARTITION BY mouv.emply_no_employe ORDER BY mouv.dt_debut desc) AS dt_fin_prec,\n           --lead(mouv.fnctn_code) OVER(PARTITION BY mouv.emply_no_employe ORDER BY mouv.dt_debut desc) AS fnctn_code_prec,\n           lag(mouv.dt_debut) OVER(PARTITION BY mouv.emply_no_employe ORDER BY mouv.dt_debut desc) AS dt_debut_suiv\n           --lag(mouv.dt_fin) OVER(PARTITION BY mouv.emply_no_employe ORDER BY mouv.dt_debut desc) AS dt_fin_suiv,\n           --lag(mouv.fnctn_code) OVER(PARTITION BY mouv.emply_no_employe ORDER BY mouv.dt_debut desc) AS fnctn_code_suiv\n      from\n                ----------------------------------------------------------------------------\n                (select avap.*\n                  from\n                      -----------------------------------------------------------------------\n                      (select mvt.emply_no_employe, mvt.dt_debut, mvt.dt_fin, mvt.fnctn_code,\n                              --lead(mvt.dt_debut) OVER(PARTITION BY mvt.emply_no_employe ORDER BY mvt.dt_debut desc) AS dt_debut_prec,\n                              --lead(mvt.dt_fin) OVER(PARTITION BY mvt.emply_no_employe ORDER BY mvt.dt_debut desc) AS dt_fin_prec,\n                              lead(mvt.fnctn_code) OVER(PARTITION BY mvt.emply_no_employe ORDER BY mvt.dt_debut desc) AS fnctn_code_prec\n                              --lag(mvt.dt_debut) OVER(PARTITION BY mvt.emply_no_employe ORDER BY mvt.dt_debut desc) AS dt_debut_suiv,\n                              --lag(mvt.dt_fin) OVER(PARTITION BY mvt.emply_no_employe ORDER BY mvt.dt_debut desc) AS dt_fin_suiv,\n                              --lag(mvt.fnctn_code) OVER(PARTITION BY mvt.emply_no_employe ORDER BY mvt.dt_debut desc) AS fnctn_code_suiv\n                         from\n                              ---------------------------------------------------------------\n                              (SELECT distinct rm.emply_no_employe\n                                 FROM rhu_mouvements rm, rhu_employes t\n                                WHERE rm.emply_no_employe = t.no_employe\n                                  and  rm.fnctn_code in ('015','315','116','032','433')  -- fonctions recherchées\n                                  and ((rm.dt_fin >= '2001-01-01' and rm.dt_debut < '2017-11-09')\n                                        or\n                                      (rm.dt_debut <= '2017-11-09' and rm.dt_fin is null)\n                                      )\n                                  and (t.dt_depart_sq >  '2001-01-01' or t.dt_depart_sq is null)\n                                 --and rm.emply_no_employe = 1005784\n                              ) empl,\n                              rhu_mouvements mvt,\n                              rhu_employes t\n                        where empl.emply_no_employe = t.no_employe\n                          and empl.emply_no_employe = mvt.emply_no_employe\n                          and ((mvt.dt_fin >= '2001-01-01' and mvt.dt_debut < '2017-11-09')\n                                or\n                              (mvt.dt_debut <= '2017-11-09' and mvt.dt_fin is null))\n                          and (t.dt_depart_sq >  '2001-01-01' or t.dt_depart_sq is null)\n                          --and mvt.emply_no_employe = 1005784\n                       order by 1,2 desc\n                      ) avap\n                  where ((avap.fnctn_code <> avap.fnctn_code_prec) or  (avap.fnctn_code_prec is null)  )\n                     --and avap.emply_no_employe = 1005784\n                 ) mouv\n           --where mouv.emply_no_employe = 1005784\n        ) fonct,\n        rhu_employes emp,\n        tcm_fonctions fct\n  where emp.no_employe = fonct.emply_no_employe\n    and fonct.fnctn_code = fct.code\n    and fonct.fnctn_code in ('032','433')\n  order by 1,6 desc"]