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
What is delimiter $$?
How can I create database in mysql?
What is pdo in mysql?
What is mysql routine?
How to Join tables on common columns.
Does mysql case matter?
How to convert character strings to numeric values?
What are the difference between and myisam and innodb?
Is mysql is a programming language?
What is mysql community edition?
What is max_used_connections in mysql?
What is the difference between mysql and sql?
What is row locking in mysql?
How do you rename a table?
In which language mysql has been written?