[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 157
  • Last Modified:

How to filte table by string length?

I want to filte a table by it's name field, the Name lenght must less than 5 character, How to set the Filter String at Table component?

Thanks
Kelvin
0
kelvinyu
Asked:
kelvinyu
1 Solution
 
simonetCommented:
Do the following:

- Set the Table's Filtered property to TRUE;

- Add this code to the OnFilter event of the TTable component:

Accept := length(trim(Table1.FieldByName('Name').asstring)) < 5;

Yours,

Alex
0
 
kelvinyuAuthor Commented:
thanks
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now