sKunKbad Posted March 27, 2014 Share Posted March 27, 2014 I'd like to query the database for appointments that were made, but only the last day that they were made. The last day might not be today or yesterday, but it could be today or yesterday. I'd like to not have to do a separate query to determine this date. Can this be done? I'm already sorting the query by another column in case it matters. Any help is appreciated. Link to comment https://forums.phpfreaks.com/topic/287334-how-to-select-only-records-from-the-last-day-but-last-day-is-not-known/ Share on other sites More sharing options...
Barand Posted March 27, 2014 Share Posted March 27, 2014 SELECT ... FROM mytable WHERE date = (SELECT MAX(date) FROM mytable) Link to comment https://forums.phpfreaks.com/topic/287334-how-to-select-only-records-from-the-last-day-but-last-day-is-not-known/#findComment-1474125 Share on other sites More sharing options...
sKunKbad Posted March 27, 2014 Author Share Posted March 27, 2014 That was fast. Thank you! Link to comment https://forums.phpfreaks.com/topic/287334-how-to-select-only-records-from-the-last-day-but-last-day-is-not-known/#findComment-1474127 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.