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 do we delete a row in a table?

998


How to use sum function in where clause in mysql?

965


How to check if a record exists in a mysql database php?

892


Which is better mysql or mssql?

927


What is triggers?

964


What is truncate command?

953


Do while loop in mysql procedure?

1077


How many sql ddl commands are supported by 'mysql'?

1137


If you are assigned a task, to find the information of procedures. What are the basic commands that you will use to do so?

954


Is mysql query case sensitive?

975


Consider a scenario where you have to send an email to a client from the sql database. How do you think you can achieve this task?

981


How do I delete a mysql user?

851


how you will Create a database on the mysql server with unix shell.

1051


Consider you have a composite index of three columns. Now, you have to provide the value of two columns in the where clause of a select query. Do you think index can be used for the operation?

1023


What is pragma autonomous_transaction?

877