Crustyfur Posted May 23, 2007 Share Posted May 23, 2007 Hi guys, I am currently using a simple CURDATE() in my query: fdate > CURDATE() Is there a way of making it +1 day? At the moment it is updating the data 24 hours before I want it too. Cheers Chris Quote Link to comment https://forums.phpfreaks.com/topic/52611-curdate/ Share on other sites More sharing options...
georg Posted May 23, 2007 Share Posted May 23, 2007 Here is the simplest way I could think of at the moment: SELECT DATE( CURDATE() + 1 ) Quote Link to comment https://forums.phpfreaks.com/topic/52611-curdate/#findComment-259612 Share on other sites More sharing options...
Crustyfur Posted May 23, 2007 Author Share Posted May 23, 2007 Thanks Georg, That worked but I had to change the +1 to -1 ??? Works though Cheers Quote Link to comment https://forums.phpfreaks.com/topic/52611-curdate/#findComment-259625 Share on other sites More sharing options...
bubblegum.anarchy Posted May 23, 2007 Share Posted May 23, 2007 SELECT adddate(CURRENT_DATE, INTERVAL 1 DAY); Quote Link to comment https://forums.phpfreaks.com/topic/52611-curdate/#findComment-259627 Share on other sites More sharing options...
fenway Posted May 23, 2007 Share Posted May 23, 2007 Here is the simplest way I could think of at the moment: SELECT DATE( CURDATE() + 1 ) Very, very bad -- always use interval, or something equivalent... I prefer "CURDATE() + INTERVAL 1 DAY". Quote Link to comment https://forums.phpfreaks.com/topic/52611-curdate/#findComment-260150 Share on other sites More sharing options...
bubblegum.anarchy Posted May 24, 2007 Share Posted May 24, 2007 wow, I did not know that the following is possible: SELECT CURRENT_DATE + INTERVAL 1 DAY; Quote Link to comment https://forums.phpfreaks.com/topic/52611-curdate/#findComment-260551 Share on other sites More sharing options...
fenway Posted May 24, 2007 Share Posted May 24, 2007 wow, I did not know that the following is possible: SELECT CURRENT_DATE + INTERVAL 1 DAY; Yes, it's absolutely wonderful, no more unnecessary functions and parens lying everywhere. Quote Link to comment https://forums.phpfreaks.com/topic/52611-curdate/#findComment-260829 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.