?
Solved

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

Posted on 2011-09-02
2
Medium Priority
?
432 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
Goodangel Matope earned 2000 total points
ID: 36473484
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
ID: 36473528
Thank you
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
In this article, we’ll look at how to deploy ProxySQL.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

764 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