The Little Guy Posted March 28, 2009 Share Posted March 28, 2009 I have this in a varchar column as "date": 1238258449.0517 can I do this? SELECT * FROM status s WHERE `date` > '1238258449.0517' ORDER BY `date` ASC LIMIT 30 if so... why don't I get any results when I do it? Quote Link to comment https://forums.phpfreaks.com/topic/151528-solved-greater-than-in-varchar/ Share on other sites More sharing options...
jackpf Posted March 28, 2009 Share Posted March 28, 2009 I had problems with this once, but when I set the column to an int it worked. Is there any reason you can't set it as an int? Quote Link to comment https://forums.phpfreaks.com/topic/151528-solved-greater-than-in-varchar/#findComment-795853 Share on other sites More sharing options...
The Little Guy Posted March 28, 2009 Author Share Posted March 28, 2009 I had problems with this once, but when I set the column to an int it worked. Is there any reason you can't set it as an int? Doesn't the decimal make it a float? Hmm.. it seems I get results if I run it on a page... wonder why php MyAdmin isn't doing it... Quote Link to comment https://forums.phpfreaks.com/topic/151528-solved-greater-than-in-varchar/#findComment-795854 Share on other sites More sharing options...
corbin Posted March 28, 2009 Share Posted March 28, 2009 If you have a numeric field, you should make it numeric. That field shouldn't be varchar to begin with. Also, numbers, when being treated as numbers, shouldn't be quoted in MySQL. Quote Link to comment https://forums.phpfreaks.com/topic/151528-solved-greater-than-in-varchar/#findComment-795952 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.