I am using MySQL.
I am trying to compare a date that is in a datetime field to today's date and return the number of days difference [i.e. today - column = no. of days]
Is that possible? How would I do it?
I think we need more information from your side, like the query you are using and what you tried so far, but maybe this can help you out:
SELECT
DATEDIFF('2014-02-20 00:00:00', NOW()); //return 7
In this case, you should add a 'FROM table' and replace the date in this query to the datetime column. Something like this:
SELECT
DATEDIFF(datetimefield, NOW())
FROM
tablename
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With