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 edit a trigger in mysql?
What are the indexes in mysql?
How to drop an existing index in mysql?
Is blocked because of many connection errors mysql?
How we can get distinct columns values in mysql?
What is a csv table?
How do I clear the screen in mysql?
What is mysql installer?
Is oracle better than mysql?
Can mysql store files?
What is row locking in mysql?
What is mysqladmin flush hosts?
What is max_used_connections in mysql?
How to list or view all databases from the mysql server.
How do I start and stop mysql on windows?