I have a datatable and I would like to filter it as follows:
For Each row As DataRow In odds.Select("OutComeGameDesc = ' FINAL RESULT ' OR OutComeGameDesc = ' Oyun Nəticəsi ' AND OutComeGame IN ( ' 1 ',' X ',' 2 ')")
But there is something wrong with the OR filter and returning result is wrong. This OutComeGameDesc column can be "FINAL RESULT" or "Oyun Nəticəsi".
How can I achieve this?
By the way, can I use MAX and MIN for a specific column also?
Best Regards.
Keep your friends close and your enemies even closer
cenk1536
Contributor
2503 Points
2118 Posts
DataTable Filter Expresion Question?
May 15, 2012 06:20 PM|LINK
Hi,
I have a datatable and I would like to filter it as follows:
For Each row As DataRow In odds.Select("OutComeGameDesc = ' FINAL RESULT ' OR OutComeGameDesc = ' Oyun Nəticəsi ' AND OutComeGame IN ( ' 1 ',' X ',' 2 ')")But there is something wrong with the OR filter and returning result is wrong. This OutComeGameDesc column can be "FINAL RESULT" or "Oyun Nəticəsi".
How can I achieve this?
By the way, can I use MAX and MIN for a specific column also?
Best Regards.
Usman Amir
Participant
790 Points
138 Posts
Re: DataTable Filter Expresion Question?
May 16, 2012 04:27 AM|LINK
Is your column have values having leading and trailing spaces like ' FINAL RESULT ' ,if not then try to use it as
For Each row As DataRow In odds.Select("OutComeGameDesc = 'FINAL RESULT' OR OutComeGameDesc = 'Oyun Nəticəsi' AND OutComeGame IN ( '1','X','2')")cenk1536
Contributor
2503 Points
2118 Posts
Re: DataTable Filter Expresion Question?
May 16, 2012 05:23 AM|LINK
Hi,
It has spaces.
sunilgurjar
Contributor
2252 Points
478 Posts
Re: DataTable Filter Expresion Question?
May 16, 2012 05:32 AM|LINK
try this
odds.Select("(OutComeGameDesc = ' FINAL RESULT ' OR OutComeGameDesc = ' Oyun Nəticəsi ') AND OutComeGame IN ( ' 1 ',' X ',' 2 ')");read my blog
http://sunilgurjar.blogspot.com/