>I have the need to create a SQL statement that pulls data from payroll check current and history files. These files a VFP 6.0 free tables with exactly the same structure. These tables also do not include a unique key. The problem is if I issue a statement such as "select * from G:\Sbtpr\PRAXIS\prchck01,G:\Sbtpr\PRAXIS\prhchk01 into cursor tccursor" the computer slows to a crawl and eventually I get an error message stating the bla bla bla temp file is too large. If I change the SQL statement to only pull from on file at a time there are now issues at all. Separately it is actually quite fast. If I specify specific fields in the combined statement I get an error stating that the first field requested in not unique. I am sure this is because the same field name exists in both tables. Can I have one SQL Statement to pull data from both files?
Use UNION
SELECT * FROM CurrentData ;
WHERE < whatever condition > ;
UNION ALL
SELECT * FROM HistoryData ;
WHERE < whatever condition > ;
...
--sb--