in reply to DBI date calculation with MySQL
It is awkward keeping a date as three integers when a DATE datatype is available. Your $sql should work if you straighten out the quotes and use stringified values from columns in the date string:
$sql = q{SELECT * FROM TTD WHERE TO_DAYS(CURDATE()) - TO_DAYS(CONCAT_WS('-',YYYY,MM,DD)) <= ?};
I've tossed in a placeholder, and assumed the obvious names for your integer date columns. Note how a datestring is built from your int columns.
After Compline,
Zaxo
|
|---|