select cedpar,concat(nompar,' ',apepar) as nombre,date_format(fecpre,'%d/%m/%Y') as fecha from gevtparticipantes,gevmdeventosparticipantes where (gevtparticipantes.codpar=gevmdeventosparticipantes.codpar) and (codeve='@1') and (gevmdeventosparticipantes.codparpar='@2')  and (  (((gevmdeventosparticipantes.tippre='S') or (gevmdeventosparticipantes.tippre='P')) and (stapatinc='S')) or ((tippre='N')) )