I have an SQL Server query that runs in milliseconds on the SQL Server Management Studio or on a TADOQuery, but takes 17 seconds to run on a TFDQuery.
SET TRA