That line close current alias & use Table1 instead change
old_alias = ALIAS()
SELECT0use table1
....
&Your code here
IF .NOT. EMPTY(old_alias)
SELECT (old_alias)
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller The only thing normal about database guys is their tables.