Want to get the difference when select mysql database
Started on: 04 February 13
Participants: 1
In my mysql database i have a field which storing data as DATETIME
Now i want to get the difference between today date and the date field i am saving.
I tried DATEDIFF() but the difference i am getting is in -20 something like that.
I want the datediff in positive value , how to get that in mysql select query.
Now i want to get the difference between today date and the date field i am saving.
I tried DATEDIFF() but the difference i am getting is in -20 something like that.
I want the datediff in positive value , how to get that in mysql select query.
This challenge is listed under
Open Source
, Development & Implementations
and Data & Information Management
Community
Related Posts:
1 Suggestion
Its simple just change the field that you used in DATEDIFF()
try the below code
select DATEDIFF(NOW(),yourdatefield) AS diff from your table