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 to show all records starting with the letters 'sonia' and the phone number '9876543210' limit to records 1 through 5.
How do I find the size of a mysql database?
What is delimiter in mysql stored procedure?
What is a storage engine?
Where is the myisam table stored?
What is mysql architecture?
How do I start mysql client?
How do I update a variable in mysql?
Where the database is stored in mysql?
How does php communicate with mysql?
Is it possible to update a table value with out using update command?. if yes what is the reason, if no what is the reason?.
What are string data types?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)