SELECT `Item`.`name`, DATE_SUB(Item.modified, INTERVAL 1 DAY),
CASE
WHEN DATE_SUB(Item.modified, INTERVAL 1 DAY) > Item.modified
THEN 'FALSE'
ELSE 'TRUE'
END status, `Item`.`restaurant_id` FROM `fs_development`.`items` AS `Item`
WHERE `Item`.`restaurant_id` = (677)
ORDER BY `modified` DESC LIMIT 1
I want to have a status field that have either ‘TRUE’ or ‘FALSE’ to indicate if a record was updated within the day.
So far the above has not been working.
1 Answer