| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Bill Gerrard | Date: | January 6 2000 9:47am |
| Subject: | RE: Calculations with dates? | ||
| View as plain text | |||
Hi Paul, My code sample was written to 3.21.x, which didn't include DATE_SUB. If it did, I would have used it there... :( > If you use the following, MySQL can take advantage of any index > on the date column. The expression above is logically equivalent, > but requires that TO_DAYS(date) be evaluated for each row in the > table. > > WHERE date >= DATE_SUB(CURDATE(),INTERVAL 7 DAY)
