ven. 14 mai 2021, 14h09

Damonzon
Mali
atoutfox.public.association
Re: Report avec une table parent et plusieurs tables enfants (4 ou 5)
Bonjour Jean,
Merci pour votre réaction rapide, je suis désolé de ne pas réagir aussitôt du, une succession de jours fériés chez nous au Mali. Je voulais joindre un fichier contenant la requête, mais j'ai pas trouvé de solution, donc je la copie ci-aprés. Merci d'avance.
IF vLancImp=.T.
SELECT societe,periode,matricule,clef,coderub,librub,montant,nbrebase,taux,tauxits,tauxret,cmotif,nbull,freq;
FROM bulldet;
GROUP BY bulldet.societe,bulldet.periode,bulldet.matricule,bulldet.clef,bulldet.coderub,bulldet.librub,bulldet.montant,bulldet.nbrebase,;
bulldet.taux,bulldet.tauxits,bulldet.tauxret,bulldet.cmotif,bulldet.nbull,bulldet.freq;
WHERE bulldet.societe=vNumSoc .and. bulldet.periode=societe.datepaie ;
INTO CURSOR crsdet
SELECT societe,periode,matricule,clef,coderub,librub,montant,nbrebase,taux,nbull,freq;
FROM bullnet;
GROUP BY bullnet.societe,bullnet.periode,bullnet.matricule,bullnet.clef,bullnet.coderub,bullnet.librub,bullnet.montant,bullnet.nbrebase,bullnet.taux,;
bullnet.nbull,bullnet.freq;
WHERE bullnet.societe=vNumSoc .and. bullnet.periode=societe.datepaie;
INTO CURSOR crsnet
SELECT societe,periode,matricule,clef,coderub,librub,codcharg,montant,nbrebase,taux,nbull,freq;
FROM bullcharg;
GROUP BY bullcharg.societe,bullcharg.periode,bullcharg.matricule,bullcharg.clef,bullcharg.coderub,bullcharg.librub,bullcharg.codcharg,bullcharg.montant,;
bullcharg.codcharg,bullcharg.nbrebase,bullcharg.taux,bullcharg.nbull,bullcharg.freq;
WHERE bullcharg.societe=vNumSoc .and. bullcharg.periode=societe.datepaie;
INTO CURSOR crscharg
SELECT societe,periode,matricule,clef,coderub,librub,montant,nbrebase,taux,nbull,freq;
FROM bulltiers;
GROUP BY bulltiers.societe,bulltiers.periode,bulltiers.matricule,bulltiers.clef,bulltiers.coderub,bulltiers.librub,bulltiers.montant,bulltiers.nbrebase,;
bulltiers.taux,bulltiers.nbull,bulltiers.freq;
WHERE bulltiers.societe=vNumSoc .and. bulltiers.periode=societe.datepaie;
INTO CURSOR crstiers
SELECT societe,periode,matricule,clef,baseamo,baseconge,baseimpot,baseinps,jrscong,jrspres,retamo,retimpot,retinps,salbrut,nbull,freq;
FROM bullcum;
GROUP BY bullcum.societe,bullcum.periode,bullcum.matricule,bullcum.clef,bullcum.baseamo,bullcum.baseconge,bullcum.baseimpot,bullcum.baseinps,bullcum.jrscong,;
bullcum.jrspres,bullcum.retamo,bullcum.retimpot,bullcum.retinps,bullcum.salbrut,bullcum.nbull,bullcum.freq;
WHERE bullcum.societe=vNumSoc .and. bullcum.periode=societe.datepaie;
INTO CURSOR crscum
SELECT societe,periode,matricule,clef,cdir,cser,nom,prenoms,nomjfille,salbase,salnet,salbrut,sitfam,conv,categ,classific,dept,serv,fonction,;
pnet,nbrenf,datentre,nbrpart,numsecu,modepaie,lpay,lpaye,nbull,freq,typsal;
FROM bullent;
GROUP BY bullent.societe,bullent.periode,bullent.matricule,bullent.clef,bullent.cdir,bullent.cser,bullent.nom,bullent.prenoms,bullent.nomjfille,bullent.salbase,bullent.salnet,bullent.salbrut,;
bullent.sitfam,bullent.conv,bullent.categ,bullent.classific,bullent.dept,bullent.serv,bullent.fonction,bullent.pnet,bullent.nbrenf,bullent.datentre,;
bullent.nbrpart,bullent.numsecu,bullent.modepaie,bullent.lpay,bullent.lpaye,bullent.nbull,bullent.freq,bullent.typsal;
WHERE bullent.societe=vNumSoc .and. bullent.periode=societe.datepaie;
INTO CURSOR crsent
SELECT crsdet.*,crsnet.coderub as rubnet,crsnet.librub as libnet,crsnet.montant as montnet,;
crsnet.nbrebase as nbrenet,crsnet.taux as tauxnet,crscharg.coderub as rubcharg,crscharg.librub as libcharg,crscharg.codcharg,;
crscharg.montant as montcharg,crscharg.nbrebase as nbrecharg,crscharg.taux as tauxcharg,crstiers.coderub as rubtiers,crstiers.librub as libtiers,;
crstiers.montant as monttiers,crstiers.nbrebase as nbretiers,crstiers.taux as tauxtiers,crscum.salbrut,crscum.baseamo,crscum.baseconge,crscum.baseimpot,crscum.baseinps,crscum.jrscong,;
crscum.jrspres,crscum.retamo,crscum.retimpot,crscum.retinps,crsent.cdir,crsent.cser,crsent.nom,crsent.prenoms,crsent.nomjfille,crsent.salbase,;
crsent.salnet,crsent.salbrut,crsent.sitfam,crsent.conv,crsent.categ,crsent.classific,crsent.dept,crsent.serv,crsent.fonction,crsent.pnet,;
crsent.nbrenf,crsent.datentre,crsent.nbrpart,crsent.numsecu,crsent.modepaie,crsent.typsal,;
ville.libelong As libville,societe.datepaie AS datpaie,societe.libelabg as libelle,societe.numfisc,societe.numsecu as numorg,;
nbull.libelle as libbull,tfreq.libelle as libfreq,conge.datedebut,conge.datefin;
From crsdet;
Left Outer Join crsnet On crsdet.matricule=crsnet.matricule .and. crsdet.clef=crsnet.clef .and.;
crsdet.societe=crsnet.societe .and. crsdet.periode=crsnet.periode .and. crsdet.nbull=crsnet.nbull .and. crsdet.freq=crsnet.freq;
Left Outer Join crscharg On crsdet.matricule=crscharg.matricule .and. crsdet.clef=crscharg.clef .and.;
crsdet.societe=crscharg.societe .and. crsdet.periode=crscharg.periode .and. crsdet.nbull=crscharg.nbull .and. crsdet.freq=crscharg.freq;
Left Outer Join crstiers On crsdet.matricule=crstiers.matricule .and. crsdet.clef=crstiers.clef .and.;
crsdet.societe=crstiers.societe .and. crsdet.periode=crstiers.periode .and. crsdet.nbull=crstiers.nbull .and. crsdet.freq=crstiers.freq;
Left Outer Join crscum On crsdet.matricule=crscum.matricule .and. crsdet.clef=crscum.clef .and.;
crsdet.societe=crscum.societe .and. crsdet.periode=crscum.periode .and. crsdet.nbull=crscum.nbull .and. crsdet.freq=crscum.freq;
Left Outer Join crsent On crsent.matricule=crsdet.matricule .and. crsdet.clef=crsent.clef .and.;
crsent.societe=crsdet.societe .and. crsent.periode=crsdet.periode .and. crsdet.nbull=crsent.nbull .and. crsdet.freq=crsent.freq;
Left Outer Join societe On crsdet.societe=societe.societe;
Left Outer Join ville On societe.pays=ville.codpays .and. societe.ville=ville.codvil;
Left Outer Join nbull On crsdet.societe=nbull.societe .and. crsdet.nbull=nbull.code;
Left Outer Join tfreq On crsdet.societe=tfreq.societe .and. crsdet.nbull=tfreq.nbull .and. crsdet.freq=tfreq.freq;
Left Outer Join conge On crsdet.matricule=conge.matricule .and. crsdet.clef=conge.clef .and. crsdet.societe=conge.societe .and.;
crsdet.periode=conge.datepaie;
ORDER BY crsdet.periode,crsdet.matricule,crsdet.clef,crsdet.coderub;
WHERE crsdet.societe=vNumSoc .and. crsdet.periode=vdatepaie .and. !DELETED();
INTO CURSOR bulletin
ELSE
CLEAR EVENTS
ENDIF
Le dernier curseur me ramène que des doublons. Je ne suis pas arrivé à faire un Group By la dessus.
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000019819