Page 1 of 1

Filters. What is more efficient and quick

Posted: Tue 11 Apr 2006 17:22
by ziclope
Hello,

I would like know what is the best method for filter in Query statement.
I dont know how filter and filtered properties are working.

What is the 2 (any more ? :) ways is more quick:

1.- Way: use filter property

MyQuery->Close();

MyQuery->Filter = Key + " = " + Value;
MyQuery->Filtered = true;

MyQuery->Open();

2.- Way: Rewrite the SQL query.

MyQuery->Close();

MyQuery->SQL->Text = "SELECT * FROM mytable WHERE Key = Value";

MyQuery->Open();

Regards

Posted: Tue 11 Apr 2006 21:01
by GEswin
Writing SQL sentence is best performance

Posted: Wed 12 Apr 2006 08:50
by Antaeus
Both ways to filter recordset ziclope has offered are dependent on various conditionals. So you should test these ways yourself in your situation to choose the best.