By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 3,068 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Saving Cumulative data via Weekly calculations

P: 1
Working on a database to keep track of employee sick time.

Need to keep track of weekly hours worked because when employee reaches 600 hours they are eligible to earn sick time.

Once earning sick time, need to run a query to calculate weekly time cards on sick time earned and used and save that result in a table to be used in next weeks calculations.

Employee will earn 1 sick time hour for every 40 hours worked.

I can run the queries but how to I save the cumulative hours worked from each time card to determine when to start earning sick time?
Jan 10 '14 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 5,331
Typically one does not save anything calculated unless for histrorical or auditing requirements (i.e. variable discounts for a merchandice sale or hotel booking, etc...).

You say that you can calculate what you need, then once you have that value then either the query, form, or report should be able to handle the basic calculation.

What I might do is:
1 query to calculate the hours worked per day for a employee with running total and a calculated field using IIF() such that when the running total >= 600 then start integer division with "RunnintTotal\40" *note that forward slash, it returns only the integer portion sortof like Mod() returns the remainders (^_^)

If you have a particular reason you need to store the results please let us know, there are several methods for this and the best one will depend on how your database is designed.
Jan 10 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.