Hi Cindy ----
You are going to have problems with this no matter what you do. If the codes are small enough, you can always do a SCAN through the code table and build a character string and then use the character string within the SQL statement via macro expansion. If this won't work for you, my suggestion would be to port the local table to the database/device of the server data. The only other alternative I see is to create a local cursor through SPT encompassing ALL GiantServerDatabase records and then create another local cursor using IN (SELECT...). Not great either.
>(VFP6) I want to do an SPT query like
>
>SELECT LotsOfData FROM GiantServerDatabase ;
> WHERE GiantServerTable.Code ;
> IN (SELECT cCode FROM LocalTable)
>
>to avoid pulling back so many records and then throwing out the ones I don't want. The LocalTable has 57 codes, and at 20+ minutes per query, I don't want to loop through my 57 codes and do 57 parameterized queries.
>
>This is data for a report which will be run monthly.
>
>Any advice? Thanks.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05