oggi ho provato a far cosi e funziona (con mssql)

in pratica tutta la stringa sql la metto dentro una variabile


dim lasele as string=" Select * from reception_0 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" "

lasele=lasele & " union Select * from reception_1 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" "
lasele=lasele & " union Select * from reception_2 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" "
lasele=lasele & " union Select * from reception_3 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" "
lasele=lasele & " union Select * from reception_4 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" "
lasele=lasele & " union Select * from reception_5 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" "
lasele=lasele & " union Select * from reception_6 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" "
lasele=lasele & " union Select * from reception_7 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" "
lasele=lasele & " order by tessera desc, datas desc "



cosi mi sono trovato comodo
anche se ancora oggi, dopo vari scervellamenti, ho realizzato una funzione che elimina gli union e seleziona dinamicamente tutte le tabelle di un db


fatemi sapere se vi puo' interessare