Possible Duplicate:
Calculate difference between 2 date / times in Oracle SQL
I have a table where PurchasedDate is maintained. I have to get the date from the system and calculate the date difference in days. datediff() is not giving tHe result as I am working in Oracle.
Sample table:
ProductID Date P101 31-DEC-2012 P102 29-DEC-2011
If P102 is returned today, the difference should be 10.
Here is a detailed description
BillID ProductID Date 101 P101 31-DEC-2012 101 P102 31-DEC-2012 102 P405 29-JUN-2012 102 P210 29-JUN-2012 105 P205 2-MAY-2012
If a customer comes to retun a product P101 with BillNo 101, then the system should calcualte the difference between the return date(which is the system date) and the purchased date. The answer for P101 should be 10 if its returned on Jan 8 2012