Filtering on a TClientDataSet is very powerful.
For the longest time I had assumed that there was no way to filter on a field that had a field name with a space in it!
I would try the following:
Table1.Filter:= ‘My field = ‘ + #39 + ‘looking for’ + #39;
And Delphi would squawk that the field ‘My’ did not exist.
I tried to place quotes around the field name. No error occurred, but the filter did not work.
After a long search I came upon a poorly documented fact that square brackets around the field name work in the TClientDataSet filter!
Table1.Filter := ‘[My field] =’ + #39 + ‘looking for’ + #39;
Table1.Filtered := True;