so suppose this column contains mainly numbers,( i.e. 40, 300, 400, 500)
and the stmt is:
Select * from table where code between '300' and '500'
the result returns 40 also, so this is not an effective way to retrieve such data.
so how to make this work out.
Best Regards,
Quote:
Originally Posted by theavitor
I'm using BETWEEN stmt to retrieve data from a varchar column code,
so suppose this column contains mainly numbers,( i.e. 40, 300, 400, 500)
and the stmt is:
Select * from table where code between '300' and '500'
the result returns 40 also, so this is not an effective way to retrieve such data.
so how to make this work out.
Best Regards,
Try Greater than 300 and less than 500 like the following:
Select * from table where code > '300' and code < '500'
what do you get?|||Hi ,
Plz try this . . .
Select * from table where convert(numeric,code) between 300 and 500. This query will wrk properly. or else mail me at mneduu@.gmail.com|||PLease try this
Select * from table where code between 300 and 500. This query will work.
I've already try this
and this quesry will also work
Select * from table where convert(numeric,code) between 300 and 500.
No comments:
Post a Comment