AnsweredAssumed Answered

Working out days late and the resulting fine

Question asked by Brucey on Feb 18, 2011

Title

Working out days late and the resulting fine

Post

Can anyone solve a problem where I have to work out the number of days late and the resulting fine for an item in a lending library database taking into account weekends and holidays, which are not to be included.

I have the fields:

Loan_date

Due_date

Return_date

Days_late

Fine

An item can be on loan for fourteen days.  If the Due_date falls on a falls on a day when closed (eg weekends or holidays) then the Due_date becomes the date the business opens. A fine of £0.50p per day is charged to the borrowers who return items after the due date. If an item is returned more than fourteen days after the Due_date there is an additional £1.00 charge.

Examples

If an item is due back on a Friday and is returned on the following Monday, the fine is £0.50p 

If an item is due back on the Wednesday the week before a one week holiday, and is returned on the Tuesday after the holiday, the fine is £2.00

Apologies for being so prescriptive, but I could do with a solution to this one - so any help appreciated.

Outcomes