at first i'm using
datediff('d', a.due_date, current_date);
but it takes too long to get the result
but how can i subtract the current_date - a.due_date
and still get the same result like when i use datediff?
thank you
Answer Posted / sudhanshu_kmr
for getting date difference you can use it.......
select to_days(now())- to_days(date);
for example-
SELECT TO_DAYS(NOW())- TO_DAYS('2010-12-01');
TO_DAYS(DATE) command return a number which is total no. of
days between '0000-01-01' and the given date.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do I rename a table in mysql?
Which is faster innodb or myisam?
What is horizontally scalable?
How do I completely remove mysql from windows?
What is the difference between database and table?
How to get a version of mysql?
How can you retrieve a portion of any column value by using a select query?
What is the difference between truncate and delete in mysql?
What are the different mysql database engines?
How to check if value already exists in mysql database in php?
How do I setup a mysql database?
How do you create a schema?
What is a csv table?
Explain the different types of mysql joins.
How do I create a schema in mysql?