Regarding: "... why the complex query takes x milliseconds to execute from > the sqlite command line but it takes 15 seconds with the APIs?"
If you were to double the timeout limit, does the query then require 30 seconds? If so, that would certainly point to a timeout you're experiencing. Donald Griggs Desk: 803-735-7834 Opinions are not necessarily those of Misys Healthcare Systems nor its board of directors.