DataTable Filter Expresion Question?http://forums.asp.net/t/1804036.aspx/1?DataTable+Filter+Expresion+Question+Wed, 16 May 2012 05:32:59 -040018040364982259http://forums.asp.net/p/1804036/4982259.aspx/1?DataTable+Filter+Expresion+Question+DataTable Filter Expresion Question? <p>Hi,</p> <p>I have a datatable and I would like to filter it as follows:</p> <pre class="prettyprint">For Each row As DataRow In odds.Select(&quot;<strong>OutComeGameDesc = ' FINAL RESULT ' OR OutComeGameDesc = ' Oyun Nticsi '</strong> AND OutComeGame IN ( ' 1 ',' X ',' 2 ')&quot;)</pre> <p>But there is something wrong with the OR filter and returning result is wrong. This OutComeGameDesc column can be &quot;<strong>FINAL RESULT</strong>&quot; or &quot;<strong>Oyun Nticsi</strong>&quot;.</p> <p>How can I achieve this?</p> <p>By the way, can I use MAX and MIN for a specific column also?</p> <p></p> <p>Best Regards.</p> <p></p> 2012-05-15T18:20:09-04:004982718http://forums.asp.net/p/1804036/4982718.aspx/1?Re+DataTable+Filter+Expresion+Question+Re: DataTable Filter Expresion Question? <p>Is your column have values having leading and trailing spaces like ' FINAL RESULT ' ,if not then try to use it as</p> <p></p> <pre class="prettyprint">For Each row As DataRow In odds.Select(&quot;OutComeGameDesc = 'FINAL RESULT' OR OutComeGameDesc = 'Oyun Nticsi' AND OutComeGame IN ( '1','X','2')&quot;)</pre> <p><br> <br> </p> 2012-05-16T04:27:13-04:004982795http://forums.asp.net/p/1804036/4982795.aspx/1?Re+DataTable+Filter+Expresion+Question+Re: DataTable Filter Expresion Question? <p>Hi,</p> <p>It has spaces.</p> 2012-05-16T05:23:27-04:004982810http://forums.asp.net/p/1804036/4982810.aspx/1?Re+DataTable+Filter+Expresion+Question+Re: DataTable Filter Expresion Question? <p>try this</p> <pre class="prettyprint">odds.Select(&quot;(OutComeGameDesc = ' FINAL RESULT ' OR OutComeGameDesc = ' Oyun Nticsi ') AND OutComeGame IN ( ' 1 ',' X ',' 2 ')&quot;);</pre> <p></p> 2012-05-16T05:32:59-04:00