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 add a new column to an existing table?

0 Answers   MCN Solutions,


What is mysql in dbms?

0 Answers  


What is the size of mysql database?

0 Answers  


What is a join? Explain the different types of mysql joins.

1 Answers  


Is the syntax correct? Explain the meaning of the syntax given below: $dbc = mysqli_connect('data.aliensabductedme.com', 'owen', 'aliensrool', 'aliendatabase');

0 Answers  


Is sqlite faster than mysql?

0 Answers  


How do I run mysql on a mac?

0 Answers  


What is difference between Sql server and MySql database? It may be silly question but i really dont know.

0 Answers  


What is required to create mysql database?

0 Answers  


What is heap table?

0 Answers  


Can I copy mysql data directory?

0 Answers  


How does mysql clustering work?

0 Answers  


Categories