<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarcrm.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SugarQuery with a Where clause field LIKE &amp;#39;%58%&amp;#39;</title><link>https://sugarclub.sugarcrm.com/dev-club/f/questions-answers/1055/sugarquery-with-a-where-clause-field-like-58</link><description>I have a field in my DB, it is type INT. Lets call it test_int so &amp;lt;?php $query = new SugarQuery ( ) ; $query - &amp;gt; from ( BeanFactory : : getBean ( &amp;#39;Accounts&amp;#39; ) ) ; $query - &amp;gt; select ( array ( &amp;#39;id&amp;#39; , &amp;#39;name&amp;#39; , &amp;#39;test_int&amp;#39; ) ) ; $query - &amp;gt; where ( ) - &amp;gt; contains</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: SugarQuery with a Where clause field LIKE '%58%'</title><link>https://sugarclub.sugarcrm.com/thread/4229?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2017 06:04:09 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:f053dbad-ea28-46cf-9b7c-d0dddbe7a4ba</guid><dc:creator>Harald Kuske</dc:creator><description>&lt;p class=""&gt;The like operator is only allowed an strings and performs a pattern search within these strings. So you would find 58, 158, 5845 or others if the datatype would be any string type like char, varchar or text.&lt;/p&gt;&lt;p class=""&gt;On int fields you can execute equal or range operators only (=, &amp;lt;, &amp;gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SugarQuery with a Where clause field LIKE '%58%'</title><link>https://sugarclub.sugarcrm.com/thread/4228?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2017 04:31:13 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:9ed9fb18-c10a-4145-b626-dc33c25ffbf8</guid><dc:creator>Kenneth Brill</dc:creator><description>&lt;p&gt;That makes sense, I&amp;#39;ll have to go back and figure out exactly why I needed to do that.&amp;nbsp; Seems to me that should generate an error and not incorrect SQL though...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SugarQuery with a Where clause field LIKE '%58%'</title><link>https://sugarclub.sugarcrm.com/thread/4227?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2017 20:19:29 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:c593666c-33cf-430c-94fe-221d94d41941</guid><dc:creator>Andr&amp;#233; Lopes</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://sugarclub.sugarcrm.com/members/kennethbrill_2d00_wallencreeksoftware"&gt;Kenneth Brill&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Once this field&amp;nbsp;is type INT so why&amp;nbsp;don&amp;#39;t you call $query-&amp;gt;where()-&amp;gt;equals() ?&lt;/p&gt;&lt;p&gt;As far I understand &amp;quot;contains&amp;quot; is a string specific condition.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>