Solved

How do you get days when subtracting a date column from the current date in mysl

Posted on 2011-09-02
2
418 Views
Last Modified: 2012-05-12
Hi

How do you getthe days value when you subtract a date from the curdate()?
SELECT
(curdate() - tracker.PP_dateDue) AS 'Days_Late'
FROM
tracker
0
Comment
Question by:matthewdacruz
2 Comments
 
LVL 11

Accepted Solution

by:
Goodangel Matope earned 500 total points
Comment Utility
USE DATEDIFF('current_date', 'old_date')

AS shown below:

SELECT
DATEDIFF(curdate() , tracker.PP_dateDue) AS 'Days_Late'
FROM
tracker
0
 

Author Closing Comment

by:matthewdacruz
Comment Utility
Thank you
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now