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. Quote Link to comment Share on other sites More sharing options...
Barand Posted September 2, 2007 Share Posted September 2, 2007 SELECT DATEDIFF(datecol,CURDATE()) as days Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
fenway Posted September 4, 2007 Share Posted September 4, 2007 Just use TO_DAYS() and subtract yourself. Quote Link to comment 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 Quote Link to comment 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.