MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

Want to get the difference when select mysql database

0
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.

Want to get the difference when select mysql database - Image 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.

Want to get the difference when select mysql database - Image 1

This challenge is listed under Open Source , Development & Implementations and Data & Information Management Community

Related Posts:

MySQL

 

DATEDIFF()

 

Initiator

1 Suggestion

  1. 04 February 13
    0

    Its simple just change the field that you used in DATEDIFF()

    try the below code

    select DATEDIFF(NOW(),yourdatefield) AS diff from your table

Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top