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


Please Help Members By Posting Answers For Below Questions

What is delimiter $$?

494


How can I create database in mysql?

489


What is pdo in mysql?

506


What is mysql routine?

461


How to Join tables on common columns.

633






Does mysql case matter?

480


How to convert character strings to numeric values?

610


What are the difference between and myisam and innodb?

511


Is mysql is a programming language?

516


What is mysql community edition?

506


What is max_used_connections in mysql?

476


What is the difference between mysql and sql?

520


What is row locking in mysql?

499


How do you rename a table?

510


In which language mysql has been written?

862