String Filter from a particular position

Dear all,

I have one problem. I need to retrive a String Field,in which i need to apply a filter.

e.g My Field is having a data ‘61011701117’.and I have many records having similar data.

e.g ‘62011701117’.


‘64011701118’. etc

I need to Retrive the records having the value ‘117’ from the position 4 to 6 .How can i do it?

Is there any way by which i can apply SETFILTER for the same purpose? please explain?



Hi Rose,

Did you try

MyRecord.SETFILTER( MyField, ‘???177*’ );

Hi Dave

Its Working…Thanks a Lot…



You can set a filter like:


or it may be easier and faster to set a conditional test like

If Copystr(variable,4,3) <>117 then


The ? act like a Place Holder in the filter, The Copystr function looks for a Starting Position (4) and the Numebr of characters that follow it (3).

Either way, Good luck Rose,


@ Rose

Glad to Help [:D] - Can you verify a solution to help others

@ Alan,

Yes this is also a solution but with the second one you will return a full record set which may have poor preformance.