Alpha Video Training
Results 1 to 2 of 2

Thread: Vacation Update Script

  1. #1
    Member
    Real Name
    Patrick Glunt
    Join Date
    May 2000
    Posts
    25

    Default Vacation Update Script

    We changed our Vacation policy and I'm not sure how to adjust the script to update the Vacation Available field in our database. Our old policy was set up as follows:

    40 hours after 1 year of service, then add 8 hours for each year after to a maximum of 160 hours (4 weeks) vacation.

    The current script is as follows and is actually set up in a global update field:

    if(year(addyears(HIRE_DATE,1))=year(ctod(%PRL_START_DATE))
    ,40,if(40+((year(ctod(%PRL_START_DATE)))-year(addyears(HIRE_DATE,1)))*8)>=160,160,40+((year(ctod(%PRL_START_DATE)))-year(addyears(HIRE_DATE,1)))*8)

    PRL_START_DATE is asked for in a date range script before running the global update.

    New Vacation policy is as follows:

    After 6 months 40 hours total
    From 1 to 4 years 80 hours total
    From 5 to 9 years 120 hours total
    For 10 years or more 160 hours total

    Any and all help with this script is greatly appreciated!

    Patrick Glunt
    Glunt Industries Inc.

  2. #2
    Member
    Real Name
    Gary Smith
    Join Date
    Apr 2000
    Posts
    180

    Default RE: Vacation Update Script

    I have not tested the following code, but it may help you think about the code in a different way:

    Pseudo Code:

    If HIRE_DATE + 6 months = PRL_START_DATE then 160
    else
    0

    Alpha Code (not tested):

    IF(cdate(addmonths(HIRE_DATE,6)) = cdate(ctod(%PRL_START_DATE)),160,
    0)))))

Similar Threads

  1. Calculating Vacation time
    By deputy956 in forum Alpha Five Version 5
    Replies: 2
    Last Post: 06-30-2005, 12:56 PM
  2. Date dialog script & report script won't combi
    By rbierman@iowbar.org in forum Alpha Five Version 5
    Replies: 6
    Last Post: 12-07-2003, 08:40 AM
  3. Update fails to find any records to update
    By joshua brimdyr in forum Alpha Five Version 5
    Replies: 6
    Last Post: 03-11-2003, 04:47 AM
  4. Update Index within script
    By Tom Patten in forum Alpha Five Version 4
    Replies: 8
    Last Post: 06-11-2002, 12:24 PM
  5. Update index script writes CDX to shadow???
    By Bill Warner in forum Alpha Five Version 4
    Replies: 3
    Last Post: 02-02-2001, 05:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •