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
List some comparisons operators used in mysql?
What is pdo in mysql?
How we can get the current date in mysql?
Write a query to find duplicate rows in table?
How do I delete a mysql user?
How important is to list the column names when doing an insert?
Where is the mysql database stored?
What is session variable in mysql?
What is mysqli_result?
What is dblink?
What is back end and front end?
What is the latest version of mysql?
What storage engines are used in MySQL?
Can you tell the difference between ereg_replace() and eregi_replace()?
What does blob mean in mysql?