Hello again,
now I have test it with a pass through query and it works! Thanks! Hello Sean Thanks a lot! Unfortunately the gemini interbase odbc driver works not with this union query. Even not if I create 3 single queries and call this in a union query. Is there an easy way to put them into a stored procedure without duplicates? Then I can get the return values by calling this stored procedure. Thank you. SELECT a.empf_sbnr, b.email FROM tbestellungen a join tsachbearbeiter b on a.empf_sbnr = b.sbnr WHERE a.status = 1 and b.email is not null UNION SELECT b.bauleiter as sbnr, e.email FROM tprojekte b join tsachbearbeiter e on b.bauleiter = e.sbnr JOIN tbestellungen a ON b.kommisionsnr = a.kommisionsnr and b.auftrag = a.auftrag where e.email is not null UNION SELECT c.sbnr, f.email FROM tprojversand c join tsachbearbeiter f on c.sbnr = f.sbnr JOIN tbestellungen a ON c.kommisionsnr = a.kommisionsnr and c.auftrag = a.auftrag where f.email is not null [Non-text portions of this message have been removed] [Non-text portions of this message have been removed]