delete from movimento where TipoDocumento='Scontrino' AND CodiceDocumento in ( SELECT IDScontrinoTServer From ScontrinoT WHERE Stato='EL' )