After writing the suspend code, I thought it may be important to show when the job was suspended incase this comes under scrutiny for why a customer has had to pay so much in labour costs.
I added a new Table called Job_suspended which would start the start time of the suspension and the end time. This is to show how many times the job has been suspended and if this comes under question by service staff or a customer the technician would need to explain why they have suspended the job.
This was done by firstly inserting the start time into the Job_suspended table along with the JobID. Then once the job was unsuspended it would be updated the Finish time. But this firstly started updating all the JobID with the same time which is what i didnt want. So i had to add in a ORDER BY operator to solve this issue. I ordered by JobID and showed them in descending order so show the lastest one started first.This would then only update the lastest Time of finish and none of the others.
No comments:
Post a Comment