Filter with integer field and LIKE

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ply
Posts: 11
Joined: Tue 27 May 2008 15:03

Filter with integer field and LIKE

Post by ply » Tue 27 May 2008 15:09

I neet to apply 'LIKE' filter to integer field:

client_id LIKE '%65%'

But error occurs: "Could not convert variant of type (String) into type (Double)"

jkuiper_them
Posts: 28
Joined: Thu 20 Dec 2007 14:48

Post by jkuiper_them » Wed 28 May 2008 07:49

I neet to apply 'LIKE' filter to integer field:

client_id LIKE '%65%'

But error occurs: "Could not convert variant of type (String) into type (Double)"
What you trying to do is not logical and isn't an iso standard of SQL.
The option LIKE is implemented for search on strings, so you can simular founded records. For integers, floats, decimals, and dates the option BETWEEN will be used. Or set your integerfield ti a stringfield. It's your choice.

Post Reply