sql - Calculated Field With Conditions -
I need your expertise on this problem. I have a vehicle / driver's inspection database and I have a traffic infringement point I am trying to create a system, this is a system when drivers humiliate some traffic offenses, they take driving and insulting points.
System: All of the violations occurred within the last 12 months, another has been added together to calculate the point total. If the accumulated points have reached 14 points then the driver has been suspended so that the number will be removed or reduced after the suspension.
Example:
Date of crime - Number of marks
- August 6, 2013 - 6
- August 6, 2013 - 6
- February. April 25, 2014 - April 25, 2014 - May 2, 2014 - 2
-
Two offenses were committed on April 25, 2014 and (August 6, 2013 - April 25, 2014) 14 points earned (6 + 4 + 4) and suspension is done, 14 points are removed. . On 2nd April 2014 the second offense will be forwarded and will be added to the 8th of May 2014 marks (total 4 marks).
- The first name
- Last name
-
- EventIID
- li> EventViolatinID
- EventID
- ViolationID
- Status (1 = No, 2 = Yes Radio Violation ID
- ViolationN
- Points
- P> tbl_ViolationClass
- ViolationClassID
- classname
Explanation: 4 April 2014 - 4
/ Li>
I created a SQL code, but adding the accumulated points, but the whole position No is. See below:
Please modify the code for any Try working on set conditions
Thanks for your time. Looking forward to the solution.
Comments
Post a Comment