Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



at first i'm using datediff('d', a.due_date, current_date); but it takes too long t..

Answer / 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

More MySQL Interview Questions

how to show all records starting with the letters 'sonia' and the phone number '9876543210' limit to records 1 through 5.

0 Answers  


How do I find the size of a mysql database?

0 Answers  


What is delimiter in mysql stored procedure?

0 Answers  


What is a storage engine?

0 Answers  


Where is the myisam table stored?

0 Answers  


What is mysql architecture?

0 Answers  


How do I start mysql client?

0 Answers  


How do I update a variable in mysql?

0 Answers  


Where the database is stored in mysql?

0 Answers  


How does php communicate with mysql?

0 Answers  


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?.

1 Answers  


What are string data types?

0 Answers  


Categories