AnsweredAssumed Answered

Finding Records created in past 30 days

Question asked by schmity on Aug 6, 2014
Latest reply on Aug 6, 2014 by philmodjunk

Title

Finding Records created in past 30 days

Post

     I am trying to create a solution that we can use to track points for employee attendance.  I have everything setup to enter the points into the database manually and it seems to be working.  If an employee is absent or late, they accrue positive points (this is done manually)

     Employee Table -->Points Table

     If an employee goes more than 30 days without accumulating any points for being late/absent, they earn 1 point back, up to a max of -2.  (So their point’s total, at the most, only be -2 or greater.)

     I'm trying to write a script to calculate subtracting points automatically with the following conditions:

         
  1.           If the employee’s points total is at -2, nothing happens (exit script)
  2.      
  3.           If the employee has accrued any positive points in the previous 30 days, nothing happens (exit script).
  4.      
  5.           If the employees total is greater than -2, and there were no records for positive points added in the last 30 days, a new record is created for -1 point.
  6.      
  7.           I would like this to automatically run every day.  Would I need to run the script on the server (it is hosted on FM Server 13)?

     I'm not sure how to attack this for conditions 2, 3 and 4.  Just looking for some suggestions to point me in the right direction.

      

     thanks!

Outcomes