Like with Integers

Like with Integers

  

Does anyone have a simple workaround for the filtering error produced when attempting to use a like operator with a field that is an integer?

SyntaxEditor Code Snippet

Mem.MemberNum like "%" + Session.Mems_Search_MemNum + "%"

Thanks!

Solution

Hi Barb,

It depends on what you want. If MemberNum is an integer, and you want the user to be able to search on a part of that number (e.g. MemberNum is 12345678 and it must match a search on 456), you need to convert the number to text first, like this:

IntegerToText(Mem.MemberNum) like "%" + Session.Mems_Search_MemNum + "%"

Note however that this is not very fast (but then again, if MemberNum was a Text attribute, it wouldn't be much faster).


Solution

Thanks,Kilian, that worked great - hoping no performance issues to deal with later!

Barb

Great to hear Barb. And yeah, full text searches are always looming performance problems, but if the data set is relatively small they're ok.