Vivid Lust Posted October 21, 2010 Share Posted October 21, 2010 Hi, I'm wanting to find rows whose date is within the next week of the current month of the current year. The format of the date is, for example: 2010-10-28 Any ideas guys? Thanks lots! Quote Link to comment https://forums.phpfreaks.com/topic/216458-getting-rows-in-particular-week-of-the-current-month-of-the-current-year/ Share on other sites More sharing options...
Vivid Lust Posted October 21, 2010 Author Share Posted October 21, 2010 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/216458-getting-rows-in-particular-week-of-the-current-month-of-the-current-year/#findComment-1124811 Share on other sites More sharing options...
litebearer Posted October 21, 2010 Share Posted October 21, 2010 possible this may guide you http://www.phpfreaks.com/forums/index.php?topic=311642.0 Quote Link to comment https://forums.phpfreaks.com/topic/216458-getting-rows-in-particular-week-of-the-current-month-of-the-current-year/#findComment-1124816 Share on other sites More sharing options...
Vivid Lust Posted October 21, 2010 Author Share Posted October 21, 2010 SELECT usuarioID, username, fechafin FROM `usr_usuarios` WHERE DATE_FORMAT( fechafin, '%y-%m-%d' ) BETWEEN DATE_FORMAT( CURDATE( ) , '%y-%m-%d' ) AND DATE_FORMAT( DATE_ADD( CURDATE( ), INTERVAL 35 DAY ) , '%y-%m-%d' ) ORDER BY `fechafin` ASC LIMIT 10 MySQL ha dicho: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''%y-%m-%d') BETWEEN DATE_FORMAT(CURDATE(), '%y-%m-%d') AND DATE_FORMAT(' at line 3 Quote Link to comment https://forums.phpfreaks.com/topic/216458-getting-rows-in-particular-week-of-the-current-month-of-the-current-year/#findComment-1124820 Share on other sites More sharing options...
ignace Posted October 21, 2010 Share Posted October 21, 2010 SELECT usuarioID, username, fechafin FROM usr_usuarios WHERE week(fechafin) = week(now()) + 1 Quote Link to comment https://forums.phpfreaks.com/topic/216458-getting-rows-in-particular-week-of-the-current-month-of-the-current-year/#findComment-1124963 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.