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
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 |
How can we store binary data in mysql?
How to check server status with 'mysqladmin'?
How to show table names with 'mysqlshow'?
What is the use of mysqli_fetch_array?
Is mysql port 3306 tcp or udp?
How to update a root password.
What is the difference between GROUP BY and ORDER BY in Sql?
12 Answers Creative, Renault Nissan, Trikon Networks,
Why do we use group by and order by function in mysql?
How do I find the size of a mysql database?
if we want to load data from a text file into a mysql table, but the columns in table are 1st: code(int) and 2nd: city(varchar), but in text file the format is 1st cityname and then code separeted by delimeters. how to load?
What is mysql and mysqli?
What data type is money?