surajkandukuri Posted December 1, 2009 Share Posted December 1, 2009 Hi all, I have a table EmployeeNumber Category completiondate First Review Second Review Third Review 1 1 1/12/08 1/12/09 1/12/10 1/12/11 1 2 1/1/09 1/1/10 1/1/11 1/1/12 Now I want to get the Nearest Review Dates for next 4 months from the present day. I would like to have a output similar to EmployeeNumber Category Reviewdate 1 2 1/1/10 In this case 1/1/09 as it is within the next 4months. Please help me in this case!! Link to comment https://forums.phpfreaks.com/topic/183625-getting-the-next-nearest-dates-in-mysql-query/ Share on other sites More sharing options...
taquitosensei Posted December 1, 2009 Share Posted December 1, 2009 how about something like this select min(DateField) as DateField from table where DateField > now() Link to comment https://forums.phpfreaks.com/topic/183625-getting-the-next-nearest-dates-in-mysql-query/#findComment-969172 Share on other sites More sharing options...
surajkandukuri Posted December 1, 2009 Author Share Posted December 1, 2009 Thanks, But it is giving me NULL value instead of 1/1/10 and also i want to have all the dates with in the next 4months. How to achieve this. Link to comment https://forums.phpfreaks.com/topic/183625-getting-the-next-nearest-dates-in-mysql-query/#findComment-969185 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.