calculation of two different time

N

nathan

im developing a payroll system which involve time calculation of the time IN,
time OUT, and office hours.

example: calculating the number of minutes/hours late or overtime per day
for the period of 1 month.

Hope you can help me formulate the proper formula for this calculation using
MS ACCESS 2003.

Thank you.
 
A

Allen Browne

Nathan, are you sure you want to go to the trouble of programming this
yourself, when there are proably professional packages available that meet
all the legal requirements in your country?

The basic approach is to use DateDiff() in a query to calculate the number
of minutes. Then divide by 60 to get hours-and-fractions of an hour.

Example, assuming Date/Time fields that contain both the date and time:
Hours: DateDiff("n", [StartDateTime], [EndDateTime]) / 60

This example avoids several traps, e.g.:
- Doesn't use field names that are reserved (such as IN.)

- Copes with shifts that roll past midnight (by storing the date and time in
the same field)

- Doesn't store the calculated duration result in a table field.
(Could be inconsistent with the calculation if you did.)

Things get more complex when you add penalty rates, overtime, non-standard
shifts, public holidays, sick-leave, paid annual leave for part/full timers
(as distinct from casual), tiered pay scales, taxation, commissions,
absenteeism, voluntary salary sacrifice, periodic changes in pay scales,
awards, non-standard work agreements, bonues, danger penalties,
superanuation, and hosts of other issues.
 
M

MGFoster

nathan said:
im developing a payroll system which involve time calculation of the time IN,
time OUT, and office hours.

example: calculating the number of minutes/hours late or overtime per day
for the period of 1 month.

Hope you can help me formulate the proper formula for this calculation using
MS ACCESS 2003.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

We probably need more info: how you are storing your times; table
design; data samples; how you expect the data to be shown; etc.?

You'll be using the DateDiff() function:

DateDiff("n", start_date, end_date)

n = show difference in minutes. See the Access VBA Help article on
DateDiff Function for more info.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSYAHHYechKqOuFEgEQIczQCgk3iH+y8osP9+taRl2AA5pwJcCpIAoNvm
+eSvnzunUfsaowFM8NLoEvoM
=X1J8
-----END PGP SIGNATURE-----
 
Z

Zillur Rahim

Please Help me about time calculation
im developing a payroll system which involve time calculation of the time IN,
time OUT, and office hours.

example: calculating the number of minutes/hours late or overtime per day
for the period of 1 month.

Hope you can help me formulate the proper formula for this calculation using
MS ACCESS 2003.

Thank you.
On Wednesday, January 28, 2009 2:14 AM Allen Browne wrote:
Nathan, are you sure you want to go to the trouble of programming this
yourself, when there are proably professional packages available that meet
all the legal requirements in your country?

The basic approach is to use DateDiff() in a query to calculate the number
of minutes. Then divide by 60 to get hours-and-fractions of an hour.

Example, assuming Date/Time fields that contain both the date and time:
Hours: DateDiff("n", [StartDateTime], [EndDateTime]) / 60

This example avoids several traps, e.g.:
- Doesn't use field names that are reserved (such as IN.)

- Copes with shifts that roll past midnight (by storing the date and time in
the same field)

- Doesn't store the calculated duration result in a table field.
(Could be inconsistent with the calculation if you did.)

Things get more complex when you add penalty rates, overtime, non-standard
shifts, public holidays, sick-leave, paid annual leave for part/full timers
(as distinct from casual), tiered pay scales, taxation, commissions,
absenteeism, voluntary salary sacrifice, periodic changes in pay scales,
awards, non-standard work agreements, bonues, danger penalties,
superanuation, and hosts of other issues.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

news:[email protected]...
 
Z

Zillur Rahim

Please Help me about time calculation
im developing a payroll system which involve time calculation of the time IN,
time OUT, and office hours.

example: calculating the number of minutes/hours late or overtime per day
for the period of 1 month.

Hope you can help me formulate the proper formula for this calculation using
MS ACCESS 2003.

Thank you.
On Wednesday, January 28, 2009 2:14 AM Allen Browne wrote:
Nathan, are you sure you want to go to the trouble of programming this
yourself, when there are proably professional packages available that meet
all the legal requirements in your country?

The basic approach is to use DateDiff() in a query to calculate the number
of minutes. Then divide by 60 to get hours-and-fractions of an hour.

Example, assuming Date/Time fields that contain both the date and time:
Hours: DateDiff("n", [StartDateTime], [EndDateTime]) / 60

This example avoids several traps, e.g.:
- Doesn't use field names that are reserved (such as IN.)

- Copes with shifts that roll past midnight (by storing the date and time in
the same field)

- Doesn't store the calculated duration result in a table field.
(Could be inconsistent with the calculation if you did.)

Things get more complex when you add penalty rates, overtime, non-standard
shifts, public holidays, sick-leave, paid annual leave for part/full timers
(as distinct from casual), tiered pay scales, taxation, commissions,
absenteeism, voluntary salary sacrifice, periodic changes in pay scales,
awards, non-standard work agreements, bonues, danger penalties,
superanuation, and hosts of other issues.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

news:[email protected]...
 
J

John W. Vinson

Please Help me about time calculation

Certainly. What kind of calculation would you like to do?

See the VBA help for Date, DateDiff, DateAdd, and DateSerial. Or post a
question with enough details that someone might be able to understand what you
want.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top