This is a discussion on date comparaison in SELECT IF(), not working within the MySQL forums, part of the Database Server Software category; --> Hello there, Can't one use date comparaison in a SELECT IF statement? Can't get it to work... this query ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello there, Can't one use date comparaison in a SELECT IF statement? Can't get it to work... this query works, it returns 3 rows: select EntryDate from Feedback where EntryDate > DATE_SUB(NOW(), INTERVAL 10 DAY) inside an IF, the same comparaison formula does not work - Answer is always NO select IF( EntryDate > DATE_SUB(NOW(), INTERVAL 10 DAY), 'YES', 'NO' ) as Answer from Feedback EntryDate type is 'datetime'. Using MySQL 4.0.25-standard so can't use DATE() or DATEDIFF() |
| ||||
| zorro wrote: > DOH!!! > Of course it works, just wasn't seeing all rows - phpMyAdmin shows > just 30 at a time !! By default, yes. Edit this row in the config file to change this behaviour: $cfg['MaxRows'] = 30; // maximum number of rows to display -- Brian Wakem Email: http://homepage.ntlworld.com/b.wakem/myemail.png |