UPDATE adherent SET codeEtatAdherent='NR'  WHERE sorti=1 AND dateSortie IS NOT NULL ;


UPDATE beneficiaire SET codeEtatBeneficiaire='NR'  WHERE sorti=1 AND dateSortie IS NOT NULL ;


UPDATE adherent SET dateSortie=(NULL) WHERE codeEtatAdherent LIKE '%S%' AND dateSortie IS NOT NULL ;

UPDATE beneficiaire SET dateSortie=(NULL) WHERE codeEtatBeneficiaire LIKE '%S%' AND dateSortie IS NOT NULL ;



UPDATE adherent SET enVigueur=0 WHERE enVigueur=1 AND sorti=1;

UPDATE beneficiaire SET enVigueur=0 WHERE enVigueur=1 AND sorti=1;


UPDATE adherent SET sorti=0 WHERE codeEtatAdherent IN ('SA','SP');


UPDATE hadherent SET sorti=0 WHERE codeEtatAdherent IN ('SA','SP');



UPDATE adherent SET dateSortie=(NULL) WHERE codeEtatAdherent IN ('V');


UPDATE hadherent SET dateSortie=(NULL) WHERE codeEtatAdherent IN ('V');




UPDATE beneficiaire SET dateSortie=(NULL) WHERE codeEtatAdherent IN ('V');


UPDATE beneficiaire SET dateSortie=(NULL) WHERE codeEtatAdherent IN ('V');