Select .F. As "Sélection",Eleves.nom As "nom_ele",Eleves.prenom As "prénom_ele",Eleves.divcod As "classe_ele",classes.libclasse,stages.début As "Début_réel",stages.fin As "Fin_réel",IIF(stages.date1,Dtoc(stages.dur1),Space(10)) As "Déb1_réel",Iif(stages.date1,Dtoc(stages.aur1),Space(10)) As "Fin1_réel",IIF(stages.date2,Dtoc(stages.dur2),Space(10)) As "Déb2_réel",Iif(stages.date2,Dtoc(stages.aur2),Space(10)) As "Fin2_réel",IIF(stages.date3,Dtoc(stages.dur3),Space(10)) As "Déb3_réel",Iif(stages.date3,Dtoc(stages.aur3),Space(10)) As "Fin3_réel",IIF(stages.date4,Dtoc(stages.dur4),Space(10)) As "Déb4_réel",Iif(stages.date4,Dtoc(stages.aur4),Space(10)) As "Fin4_réel",IIF(stages.date5,Dtoc(stages.dur5),Space(10)) As "Déb5_réel",Iif(stages.date5,Dtoc(stages.aur5),Space(10)) As "Fin5_réel",Periodes.Type As "Type_Stage",Entreprises.raisonsoci As "Entreprise",Entreprises.service As "Serv_entr",Entreprises.cp As "CP_entr",Entreprises.ville As "Ville_entr",Eleves.refeleve As "ref_ele",Eleves.datenais As "naiss_ele",Eleves.mef As "MEF_ele",Eleves.specmef As "spec_ele",codesmef.intitule As "lib_spec",classes.diplome As "diplome_cl",Eleves.regime As "regime_ele",stages.regimestag As "regime_sta",Eleves.anneescola,Iif(Eleves.sexe="F","Mademoiselle","Monsieur    ") As "sexe_ele", Eleves.respnom As "respnom_ele", Eleves.respprenom As "respre_ele",Eleves.lienresp As "parent_ele",Eleves.adresse As "adress_ele",Eleves.adresse2 As "adres2_ele",Eleves.cp As "cp_ele",Eleves.ville As "ville_ele",Eleves.tel As "tel_ele",Eleves.portable As "portable_ele",Eleves.telresp As "telresp_ele",Periodes.numéro As "no_periode",Periodes.début As "Début_prév",Periodes.fin As "Fin_prévue",Professeurs_b.nomusuel As "Nom_coordo",Professeurs_b.prénom As "Prn_coordo",Professeurs_b.civilité As "civ_coordo",Professeurs_b.spécialité As "Spé_coordo",Entreprises.numéro As "Num_entr",Entreprises.adresse As "Adres_entr",Entreprises.adresse2 As "Adr2_entr",Entreprises.ape As "ape_entr",Entreprises.siret As "siret_entr",Entreprises.bp As "bp_entr",Entreprises.pays As "pays_entr",Entreprises.tel As "tel_entr",Entreprises.fax As "fax_entr",Entreprises.email As "email_entr",Entreprises.www As "Web_entr",Entreprises.specialite As "spec_entr",stages.titretuteu As "titut_entr",stages.nomtuteur As "nomtu_entr",stages.prentuteur As "pretu_entr",stages.fctuteur As "fctut_entr",Professeurs.nomusuel As "nom_suivi",Professeurs.prénom As "pren_suivi",Professeurs.civilité As "civ_suivi",Professeurs.spécialité As "spec_suivi",periodes.dureep, periodes.typdur As "typdur_prev",periodes.modalités As "Modal_prév",stages.modalités As "modal_réel",stages.terminé,stages.bilan,stages.absences,stages.motifs,stages.numéro As "numstage",Fraiseleves.lieuheberg,Fraiseleves.typheberg ,Fraiseleves.lieurestau,Fraiseleves.typrestau,Fraiseleves.modetransp,ICASE(stages.date1=.T.,Iif(((stages.dur1 - Eleves.datenais)/365)<18,"mineur","majeur"),stages.date2=.T.,Iif(((stages.dur2 - Eleves.datenais)/365)<18,"mineur","majeur"),stages.date3=.T.,Iif(((stages.dur3 - Eleves.datenais)/365)<18,"mineur","majeur"),stages.date4=.T.,Iif(((stages.dur4 - Eleves.datenais)/365)<18,"mineur","majeur"),"Date non cochée dans la fiche du stagiaire !") As "Age",alltrim(Str(Fraiseleves.distance,6,1)) As "dist_stag",Alltrim(Str(Fraiseleves.nbtrajstag)) As "dureestage",Alltrim(Str(Fraiseleves.fraisdepla,9,2)) As "fraisdepla",Alltrim(Str(Fraiseleves.fraisheber,9,2)) As "fraisheber",Alltrim(Str(Fraiseleves.fraisresta,9,2)) As "fraisresta",Alltrim(Str(Fraiseleves.fraisdiv,9,2)) As "fraisdiv",Alltrim(Str(Fraiseleves.fraisdepla+Fraiseleves.fraisheber+Fraiseleves.fraisresta+Fraiseleves.fraisdiv,9,2)) As "total_frai",Fraiseleves.datemandat,Entreprises.police As "Num_ass" ,Entreprises.compagnie As "Comp_ass" ,Entreprises.cp2 As "CP_serv",Entreprises.ville2 As "Ville_serv",stages.visite1 As "Visite_1",stages.visite2 As "Visite_2",stages.visite3 As "Visite_3",stages.visite4 As "Visite_4",stages.visite5 As "Visite_5",Entreprises.adresseb As "Adresb_entr",Entreprises.adresse2b As "Adr2b_entr",Eleves.transport As "Trsp_Hab" ,ICASE(stages.date1=.T.,str(Floor((stages.dur1 - Eleves.datenais)/365)),stages.date2=.T.,str(Floor((stages.dur2 - Eleves.datenais)/365)),stages.date3=.T.,str(Floor((stages.dur3 - Eleves.datenais)/365)),stages.date4=.T.,str(Floor((stages.dur4 - Eleves.datenais)/365)),"00") As "Age2" ,editions.Document,Dtoc(editions.dateimpres) As "dateimpres",Dtoc(editions.dateenvoi) As "dateenvoi",Dtoc(editions.dateretour) As "dateretour",Professeurs_b.tél As "tel_coordo" ,Professeurs_b.portable As "portable_c",Professeurs_b.Mail As "mel_coordo" ,Professeurs.tél As "tel_suivi" ,Professeurs.portable As "portable_s",Professeurs.Mail As "mel_suivi" ,Entreprises.telserv As "tel_serv",Entreprises.faxserv As "fax_serv",Entreprises.mailserv As "mail_serv",Entreprises.webserv As "web_serv",Alltrim(Str(Entreprises.distance,6,1)) As "dist_entr",Entreprises.statjurd As "statutjurd",Eleves.domiciliat,Eleves.titulaire,Eleves.iban, Eleves.bic,Periodes.coordo2,stages.horstag,iif(stages.entreprise=0,0,stages.durstage) as "durstage",stages.typdur,stages.durtotale,stages.dureeptot,stages.durstag2,stages.typdur2,stages.durstag3,stages.typdur3,Eleves.numsecu,Eleves.nommed,Eleves.datemed ,Periodes.nbelev,Eleves.email As "email_ele",Eleves.police As "ele_police",Eleves.compagnie As "ele_assur",Fraiseleves.divers As "div_frais",Eleves.vilnais,stages.attest,Periodes.objectifs,Periodes.travaux,Periodes.evaluation,stages.teltut, stages.mailtut,stages.suivi2 As "num_suivi2",Periodes.specmef as "Groupe", eleves.portresp, eleves.nomprof as "referent", strtran(Sys(5)+Sys(2003),"\","\\")+"\\"+Left(Alltrim(str(Eleves.refeleve)),LEN(Alltrim(str(Eleves.refeleve)))-2)+".bmp"as "PHOTO", eleves.avertele as "avertis", stages.nuit as "travnuit", classes.examen, Eleves.civresp, stages.rat1, stages.rat2, stages.rat3, stages.rat4, stages.rat5, stages.memo, stages.derogation as "derog_stg",stages.hor1,stages.hor2,stages.hor3,stages.hor4,stages.hor5,stages.hor6,stages.hor7,stages.hor8, eleves.datemb,eleves.nonat,periodes.dureep2, periodes.typdur2 As "typdurp2",periodes.dureep3, periodes.typdur3 As "typdurp3", periodes.titrestag as "titre_stag", classes.filiere, eleves.obsermed,eleves.avisopt,stages.destciv,stages.destnom,stages.destpren,stages.destfct,stages.desttel,stages.destmel,entreprises.attestE as "derog_ise", Iif(Eleves.avisopt=2,"Avis favorable",Iif(Eleves.avisopt=3,"Avis défavorable","Pas d'avis      ")) As "avismed",Iif(stages.apprentis,"Contrat d'apprentissage",Space(30)) As "Apprentis",Eleves.dentree,Eleves.mailresp,PERSO_CPE as "CPE",str(Floor((date() - Eleves.datenais)/365)) As "Age3"