I'm having problems using "<>" as criteria for a varchar column in a
view. The data in this column is '2008-2009' which is supposed to
mean year 2008 thru 2009. If I set the criteria to "= '2008-2009'"
then the view returns just those rows with that field equal to
"2008-2009", like I would expect it to. But if I change the criteria
to "<'2008-2009'", the view returns nothing. And there are rows to
return. I tried CAST and CONVERT, thinking the view was interpreting
the criteria as numbers, but that didn't help. I tried both
CAST('2008-2009' AS varchar(9)) and CONVERT(varchar (9), '2008-2009').
Both would work with "=" but not with "<>".
I tried using "<>" on another column in the table and it worked fine.
This was a "last name" column so there weren't any numbers.
Any help or advice appreciated.
view. The data in this column is '2008-2009' which is supposed to
mean year 2008 thru 2009. If I set the criteria to "= '2008-2009'"
then the view returns just those rows with that field equal to
"2008-2009", like I would expect it to. But if I change the criteria
to "<'2008-2009'", the view returns nothing. And there are rows to
return. I tried CAST and CONVERT, thinking the view was interpreting
the criteria as numbers, but that didn't help. I tried both
CAST('2008-2009' AS varchar(9)) and CONVERT(varchar (9), '2008-2009').
Both would work with "=" but not with "<>".
I tried using "<>" on another column in the table and it worked fine.
This was a "last name" column so there weren't any numbers.
Any help or advice appreciated.
Comment