coupe-r Posted December 19, 2010 Share Posted December 19, 2010 Hi All, I'm trying to get the last updated record while my updated_on column is in DATETIME format (Y-m-d H:i:s). I have: SELECT * FROM properties WHERE updated_on < date(now()) but know this isn't right. Also, if multiple records are updated on the same day, I would like it to look at the times and pick the latest time. Any help would be greatly appreciated. Thank you for reading!! Link to comment https://forums.phpfreaks.com/topic/222109-finding-last-updated/ Share on other sites More sharing options...
smerny Posted December 19, 2010 Share Posted December 19, 2010 I would like it to look at the times and pick the latest time. are you just looking for this? SELECT * FROM properties ORDER BY updated_on DESC LIMIT 1 Link to comment https://forums.phpfreaks.com/topic/222109-finding-last-updated/#findComment-1149142 Share on other sites More sharing options...
coupe-r Posted December 19, 2010 Author Share Posted December 19, 2010 WOW, I thought I had to get the date functions involved. Soo simply and it didn't even cross my mind. Thank you very much Link to comment https://forums.phpfreaks.com/topic/222109-finding-last-updated/#findComment-1149144 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.