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

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


Please Help Members By Posting Answers For Below Questions

How to dump one database for backup.

925


Can you tell how many values can set the function of mysql to consider?

959


How do you shutdown a mysql database?

1026


What is the use of i-am-a-dummy flag in mysql?

988


What is difference between pdo and mysqli?

952


Do while loop in mysql procedure?

1055


How do I create a stored procedure in mysql?

878


What is back end and front end?

890


Is mysql a backend?

914


List the different types of normalization?

934


How can you import tables from a sql file into a database by using the mysql client?

1022


How does mysql store data?

918


What are programming functions?

930


What are the disadvantages of mysql?

1048


Can I install mysql on mac?

961