>Hi Mandy,
>
>yet another approach is this
>create an array with the tables. Call it laTables
>create an array with the agencys. Call it laAgencys
>Store the tables and the agencys in the arrays (use SQL to store them)
>
>run this code
>
>for ix=1 to alen(laAgencys)
>lcCommand="SELECT * FROM lcMytable INTO TABLE c:\mainwork\lcAgency\lcMytable WHERE acode=lcAgency"
>lcCommand=strtran(lcCommand,"lcAgency",alltrim(laAgencys[i]))
>for iz=1 to alen(laTables)
>lcCommand=strtran(lcCommand,"lcMyTable",alltrim(laTables[i]))
>&lcCommand
>endfor
>endfor
>
>/Pierre Unge, Sweden
Sholud be
>for ix=1 to alen(laAgencys)
>lcCommand="SELECT * FROM lcMytable INTO TABLE c:\mainwork\lcAgency\lcMytable WHERE acode=lcAgency"
>lcCommand=strtran(lcCommand,"lcAgency",alltrim(laAgencys[ix]))
>for iz=1 to alen(laTables)
>lcCommand=strtran(lcCommand,"lcMyTable",alltrim(laTables[iz]))
>&lcCommand
>endfor
>endfor
------------- if you cut here, you'll probably destroy your monitor ------------