> to might be a reserved word. either use > tablename AS to > or try a different alias. That was it! I really wouldn't have thought of that (rusty coding skills...), thanks! Peter