March 18, 2011 at 11:58 am
Im doing ICT AS level and need to find the difference between two dates, then add 20p to the fine column per day, and if it's over 14 days late, I need to add an extra £1....
N.B I am not going to bother about the holidays... HERE IS THE ACTUAL QUESTION:
A book can be on loan for fourteen days. The due date is the Loan date plus fourteen days. If the Due date falls on a day when the school is closed (e.g. during a holiday period) then
the Due date becomes the date that the school reopens. A fine of £0.20 per school day is charged to
borrowers who return books after the Due date. If a book is returned more than fourteen school days
after the Due date there is an additional £1.00 charge.
Here is my sql code so far, I have set fine to 0...
SELECT Student.Name, Student.Class, Loan.[Loan date], [Loan Date]+14 AS [Due Date], Loan.[Return date], 0 AS Fine
FROM Student INNER JOIN ((Book INNER JOIN Copy ON Book.Book_ID = Copy.Book_ID) INNER JOIN Loan ON Copy.Copy_ID = Loan.Copy_ID) ON Student.Student_ID = Loan.Student_ID;
March 18, 2011 at 12:22 pm
are you selecting the fine or so you need to run some job on a daily basis that will update a fine field to store the current fine for an individual?
Dan
If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.
March 18, 2011 at 12:22 pm
Seriously!?! Your asking for us to help you with a problem directly from a certification course you're taking?
If you have a specific question about SQL I would be happy to help as I am sure others would too...but asking for help with your homework by posting the exact question and asking others to do the work is just plain lazy and somewhat dishonest. Hopefully, for the sake of any future employers you have, you'll reconsider your approach.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 18, 2011 at 12:45 pm
Your post title is correct. This is a simple task.
So why did you post it?
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply