sotusotusotu Posted April 28, 2009 Share Posted April 28, 2009 Hi guys, I'm sure there might be a way of doing this with pure SQL, however, as I haven't had this issue before I'm unsure. I have a datetime field in my database named 'letter_dispatch_date' (2009-04-26 22:07:59). I am basically trying to check if it has been exactly a week after an entry. So for example, on 2009-05-05 23:08:00 I want to be able to tell if this issue is true then proceed. I hope this makes sense and someone can give me an example. Cheers guys, Andy Link to comment https://forums.phpfreaks.com/topic/156013-checking-for-a-week-later/ Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted April 28, 2009 Share Posted April 28, 2009 SELECT DATE_ADD('2009-04-26', INTERVAL 1 WEEK) http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-add Link to comment https://forums.phpfreaks.com/topic/156013-checking-for-a-week-later/#findComment-821317 Share on other sites More sharing options...
sotusotusotu Posted April 28, 2009 Author Share Posted April 28, 2009 Thanks for the quick response. All sorted. Just in case any wants to know the SQL is: SELECT DATE_ADD( letter_dispatch_date, INTERVAL '7' DAY ) FROM 365_letters_sent Link to comment https://forums.phpfreaks.com/topic/156013-checking-for-a-week-later/#findComment-821326 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.