Jump to content

Calculating overdue fine


CaesarII

Recommended Posts

Hello all, I’m using oracle 10g forms builder to create dvd rental system, the problem I’m having is calculating the overdue fine. I already have the date the dvd is rented out, $$date$$, and the date due, sysdate + 7 (i.e. 7 days after date out), i however as perversely stated have no idea how to calculate the fine (which is charged at £2.00 a day) and any help would be appreciated. Thanks, CaesarII

Link to comment
Share on other sites

How far have you got on your if statement? Please post what you have.

Link to comment
Share on other sites

I forgot this is in the sql forum so the if becomes a WHERE. So, your code would look something like this:

"UPDATE table SET fine = 2 WHERE TIMESTAMP(NOW()) BETWEEN TIMESTAMP(rental_date) AND TIMESTAMP(WEEK,1,rental_date) AND customer_id = '$customer_id_selected" 

Edited by niche
Link to comment
Share on other sites

The sql I know is mysql. Perhaps, someone else can help that knows the oracle version.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...