I have the current datetime and a datetime field and i want to calculate the difference between these 2 and return the days as a field name.
pseudo code:
SELECT days(datetime-now()) as datestart FROM ...
please advice
SELECT (TO_DAYS(NOW())-TO_DAYS(datetime)) FROM ...
as long as you dont have date values before 1582 a.D. (the start of the gregorian calendar) this should work fine 😉