Aug 27, 2009 #1 Auguy Programmer May 1, 2004 1,206 US I was trying to use the following code. Code: dtTable.DefaultView.RowFilter = "Math.Abs(Company) = 2" It doesn't work and I got around it, but was wondering what would work? Auguy Northwest Ohio
I was trying to use the following code. Code: dtTable.DefaultView.RowFilter = "Math.Abs(Company) = 2" It doesn't work and I got around it, but was wondering what would work? Auguy Northwest Ohio
Aug 27, 2009 #2 RiverGuy Programmer Jul 18, 2002 5,011 US Code: dtTable.DefaultView.RowFilter = "Company = 2 OR Company = -2" Or, add another column to your select statement: Code: SELECT *, ABS(Company) AS CompanyABS FROM SomeTable Code: dtTable.DefaultView.RowFilter = "CompanyABS = 2" Upvote 0 Downvote
Code: dtTable.DefaultView.RowFilter = "Company = 2 OR Company = -2" Or, add another column to your select statement: Code: SELECT *, ABS(Company) AS CompanyABS FROM SomeTable Code: dtTable.DefaultView.RowFilter = "CompanyABS = 2"
Aug 27, 2009 Thread starter #3 Auguy Programmer May 1, 2004 1,206 US Thanks RiverGuy, I can do that. Just thought I was missing something obvious. Auguy Northwest Ohio Upvote 0 Downvote
Aug 27, 2009 #4 RiverGuy Programmer Jul 18, 2002 5,011 US You might also try: Code: dtTable.DefaultView.RowFilter = "Abs(Company) = 2" I'm not sure if RowFilter uses ANSI-SQL type syntax. If it does, and if ABS is an ANSI-SQL function, then that just might work. Upvote 0 Downvote
You might also try: Code: dtTable.DefaultView.RowFilter = "Abs(Company) = 2" I'm not sure if RowFilter uses ANSI-SQL type syntax. If it does, and if ABS is an ANSI-SQL function, then that just might work.