After a few trial, I finally figure out how to select just the next appointment... as follows:
SELECT a.case_no, min(a.appt_time) FROM appt_table a where a.case_no in (select b.case_no from pt_tx2 b where b.tx_date = '2006-10-06') and a.appt_time > '2006-10-06' group by 1 order by 1
But the speed is still 33s ?!
Best regards,
Aaron Chu
********************************************************
Working with Visual FoxPro is a lot of FUN!
********************************************************