like query
-
hi my data field is integer i give a query like this select * from news where newsid like '123%' it display error i want to display news where my newsid is start with 123 please help me
-
hi my data field is integer i give a query like this select * from news where newsid like '123%' it display error i want to display news where my newsid is start with 123 please help me
-
hi my data field is integer i give a query like this select * from news where newsid like '123%' it display error i want to display news where my newsid is start with 123 please help me
You need to cast your newsid to varchar.
-
You need to cast your newsid to varchar.
-
Yes there is the like operator is not valid agains a numeric or date field. Note the field is an integer. Either turn it into a varchar or use numeric operators
Never underestimate the power of human stupidity RAH
-
I was thinking the same thing, but
like
implicitly coverts int's to varchar. I think it would help a lot if we knew what the error is instead of guessing.Scott Clewell wrote:
but like implicitly coverts int's to varchar
Ok - I was not aware of that, it still feels like he is attempting the wrong thing, I would never rely on an implicit conversion there is a cost in the implicit conversion that I find unacceptable and the bloody thing will bite you sometime in the future.
Never underestimate the power of human stupidity RAH
-
hi my data field is integer i give a query like this select * from news where newsid like '123%' it display error i want to display news where my newsid is start with 123 please help me
i got it why you got this error!!! You cannot use a Like wild card with Integers .. is ur newsid is int? Cheers,
ZAK