DarkPrince2005 Posted September 2, 2007 Share Posted September 2, 2007 Can somebody help me, I'd like to calculate the date difference between the current date and a date from my database and return a answer in days. Link to comment https://forums.phpfreaks.com/topic/67682-date-query-in-days/ Share on other sites More sharing options...
Barand Posted September 2, 2007 Share Posted September 2, 2007 SELECT DATEDIFF(datecol,CURDATE()) as days Link to comment https://forums.phpfreaks.com/topic/67682-date-query-in-days/#findComment-340041 Share on other sites More sharing options...
DarkPrince2005 Posted September 4, 2007 Author Share Posted September 4, 2007 That doesn't seem to work with mysql 5.0 Link to comment https://forums.phpfreaks.com/topic/67682-date-query-in-days/#findComment-341141 Share on other sites More sharing options...
fenway Posted September 4, 2007 Share Posted September 4, 2007 Just use TO_DAYS() and subtract yourself. Link to comment https://forums.phpfreaks.com/topic/67682-date-query-in-days/#findComment-341555 Share on other sites More sharing options...
Barand Posted September 4, 2007 Share Posted September 4, 2007 Don't see a problem with DATEDIFF. Works with my MySQL 5.0 Link to comment https://forums.phpfreaks.com/topic/67682-date-query-in-days/#findComment-341589 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.