each query takes a longer than 5 minutes, until i try to join the temp table with the final results. that query takes longer than 45 minutes. the error i get on the table variable is that it is not declared. like it just goes away when it gets to the final select.
Randy Belcher
AFG Industries, Inc.