I need to get number of days between 2 dates, a given one and current date.
But in pure SQL, I mean without usign functions, it is possible?
For exaple
SELECT days (t.givenDate) - days (current date) FROM table t
Have you any idea?
Thaks a lot.
The built-in function is
datediff()
. The equivalent for the above is:Normally,
givenDate
would be in the past and you would want the arguments in the other order.