MySQL Forums
Forum List  »  Newbie

Re: calculating prices
Posted by: Caroline C
Date: December 07, 2014 06:28AM

Hi Sorry one more question on this!
SELECT TRANSACTION_NO, RENT_DATE,DATE_RETURNED, due_date,CODE,OVERDUE_FEE,RENTAL_FEE
FROM RENTAL_DETAILS JOIN PRICE_CODE USING (CODE)
WHERE DATE_RETURNED IS BETWEEN ’2014-06-01’ AND ‘2014-06-30’
OR RENT_DATE IS BETWEEN ‘2014-06-01’ AND ‘2014-06-30’;

I have this code and it works until I add the OR in on line 5.I'm typing this into SQL from word so I know the issue isnt with the Microsft word inverted commas.

Also on this I need to calculate total revenue in the given period. It works that a customer pays the price in price code under rental_fee at rent_date. This is if library book is returned on time,If the library book is not retrned on time, he needs to pay no of nights overdue(due_date-date_returned)*value in overdue_fee.


Any suggestions on how to do this code? I'd say it would have to be an ad on to the code above.

Any help is appreciated!

Options: ReplyQuote


Subject
Written By
Posted
December 07, 2014 04:40AM
December 07, 2014 04:41AM
Re: calculating prices
December 07, 2014 06:28AM
December 07, 2014 11:36AM
December 08, 2014 06:42AM
December 07, 2014 11:25AM
December 07, 2014 11:24AM
December 08, 2014 06:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.