I have a DATETIME column in my table and I would like to know the number of days between the DATETIME value and now.
The query must be something like this:
SELECT *, DATESUBWHATEVER(datetimefield) AS days FROM table
I have a DATETIME column in my table and I would like to know the number of days between the DATETIME value and now.
The query must be something like this:
SELECT *, DATESUBWHATEVER(datetimefield) AS days FROM table
You can use the DATEDIFF() function
SELECT *, DATEDIFF(DateTimeField,NOW()) FROM TABLE
DATEDIFF parameters explained:
DATEDIFF(date1,date2)