C
Claire
I'm working on writing a query for vacation accrual, but I think there's a
simpler way to do it. I just can't think of it.
What's going on:
People have different vacation accrual levels (1-4). At each level they
accrue a certain number of vacation hours for each 50 hour period, have a
certain number of hours to work before advancing to the next level, and have
a maximum number of hours that can be accumulated. Currently I'm writing long
if statements that include all of the higher levels for each lower level, and
I'm thinking that really I should have an accrual table and that that should
create a person's current rate. I just can't figure out how to link it
appropriately.
Here's what that table would look like:
Level--# Hours before next level--#hrs for each 50 hour period-Max accumulated
1----------4,000---------------------1-------------------------60
2----------6,000---------------------2-------------------------120
3---------10,000---------------------3-------------------------180
4-----------n/a-----------------------4-------------------------240
Further fun enters because this table only holds for hourly employees.
Salaried have a similar table, but it depends on the number of months they've
worked.
Other tables include the hours each employee has worked, when they
started/ended, their starting vacation rate, and if they are salaried/hourly.
I feel like it's all there, but I'm having a problem seeing past the long
ifs.
Thanks for any help, and let me know if I can clarify any part of this.
simpler way to do it. I just can't think of it.
What's going on:
People have different vacation accrual levels (1-4). At each level they
accrue a certain number of vacation hours for each 50 hour period, have a
certain number of hours to work before advancing to the next level, and have
a maximum number of hours that can be accumulated. Currently I'm writing long
if statements that include all of the higher levels for each lower level, and
I'm thinking that really I should have an accrual table and that that should
create a person's current rate. I just can't figure out how to link it
appropriately.
Here's what that table would look like:
Level--# Hours before next level--#hrs for each 50 hour period-Max accumulated
1----------4,000---------------------1-------------------------60
2----------6,000---------------------2-------------------------120
3---------10,000---------------------3-------------------------180
4-----------n/a-----------------------4-------------------------240
Further fun enters because this table only holds for hourly employees.
Salaried have a similar table, but it depends on the number of months they've
worked.
Other tables include the hours each employee has worked, when they
started/ended, their starting vacation rate, and if they are salaried/hourly.
I feel like it's all there, but I'm having a problem seeing past the long
ifs.
Thanks for any help, and let me know if I can clarify any part of this.