473,508 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to calculate man hours for different project ?

================================================== ==========================
02-Feb-04 03-Feb-04
Staff Staff 0800hr- 1300hr- 1700hr- 1900hr- 0800hr- 1300hr- 1700hr-
1900hr-
Number Name 1200hr 1700hr 1900hr 2200hr 1200hr 1700hr 1900hr
2200hr
================================================== ==========================
4654 Saniff A A A C A A A C
4437 Joey B C B C B C B C
4479 Elmer C C B C C C B C
4484 Garry C C A B C C A B
4509 Philip A C A B A C A B
4903 Siti A C A B A C A B
=> The above monthly data is from excel (staffproject.xls). It comes
with staff number, staff name and 1 month timeslot data (divided into
4 time slots for each day). Each time slot is equivalent to the 4
hours, 4 hours, 2 hours, 3 hours respectively. "A,B,C,D" represent
project code. My question is :

1. I have import te excel xls into access database. Using Access, How
do I calculate for Project A,B,C,d, how many man hours are used for
different project?

I would appreciate if any body could share some light on this.
Nov 12 '05 #1
1 13585
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

First, put the data into normalized tables so you can create queries
without tearing your hair out in frustration. Copy Excel data into a
temporary table before starting.

Let's make some lookup tables before the main table:

StaffNames
StaffID Long integer - your Staff Number - primary key
StaffName Text

===================== 2 definitions of TimeSlots

TimeSlots (1)
SlotID AutoNumber (long integer)
StartTime DateTime - only store the Time
EndTime DateTime - only store the Time

Primary Key is StartTime & End Time. SlotID is a unique index.

You could also design the table like this:

TimeSlots (2)
SlotID AutoNumber
Duration Byte (0-255 hrs)

Primary Key is Duration. SlotID is a unique index.

This TimeSlots design (2) would be used if you just wanted the hours
worked for the time slot and weren't interested in the actual time
begin & end per time slot. This table design makes the query easier
to write 'cuz it won't have to calculate the time between Start & End
time.

=====================

Now the table that holds the staffs' project times (main table):

ProjectTimes
StaffID Long integer FK to StaffNames.StaffID
WorkDate DateTime
SlotID Long integer FK to TimeSlots.SlotID
ProjectCode Text(1)

Primary Key of all fields, or all fields except ProjectCode, if the
staff member can only work on one project at a time. To be safe make
PK all fields.

[Queries using JET SQL]

Query to get hours worked - using TimeSlots (2) table:

SELECT PT.ProjectCode, Sum(TS.Duration) As HrsWorked
FROM ProjectTimes As PT INNER JOIN TimeSlots As TS
ON PT.SlotID = TS.SlotID
WHERE PT.ProjectCode In ("A", "B", "C", "D")

Using TimeSlots (1) table:

SELECT PT.ProjectCode, Sum(TS.Duration) As HrsWorked
FROM ProjectTimes As PT INNER JOIN
[ SELECT SlotID, DateDiff("h", StartTime, EndTime) As Duration
FROM TimeSlots ]. As TS ON PT.SlotID = TS.SlotID
WHERE PT.ProjectCode In ("A", "B", "C", "D")

This query uses an undocumented feature of JET SQL - the []'s around a
tabular subquery. Be sure to put a period immediately after the right
hand bracket.

Easier maintenance is using TimeSlots (1) table 'cuz all you have to
do is change the Start/End times & the calculation query will get the
correct duration. TimeSlots (2) table requires db maintainer to
correctly calc the duration & update the Duration column - human
arithmetic error possible.

The hard part is putting the Excel data into the normalized tables.

TimeSlots can be entered by hand (only 4 records).

StaffNames table can be loaded by reading the Staff Number & Staff
Name columns:

INSERT INTO StaffNames ...
SELECT DISTINCTROW StaffNumber, StaffName
FROM <temp table>)

DISTINCTROW (hopefully) eliminates duplicates.

ProjectTimes will have to be filled by reading Staff Number and
ProjectCode for each Time column. You'll have to manually put in the
SlotID & WorkDate for each INSERT INTO query. You'll have 1 INSERT
query for each column of time slots. Just set up 1 INSERT query w/
the criteria for the 1st column in the temp table & run it. Then
change the criteria to the next column & run query. Continue until
all columns have been moved into the ProjectTimes table.

Should only take about 1 hr to set up tables & move data into tables.
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQDWp84echKqOuFEgEQIzGwCeIDLUfOrc93XhKNFIHO9Jpe ZwCNoAn29I
jGQwiogH5VMmaoQFy0p6DW5O
=QkRa
-----END PGP SIGNATURE-----
sg*****@yahoo.com.sg wrote:
================================================== ==========================
02-Feb-04 03-Feb-04
Staff Staff 0800hr- 1300hr- 1700hr- 1900hr- 0800hr- 1300hr- 1700hr-
1900hr-
Number Name 1200hr 1700hr 1900hr 2200hr 1200hr 1700hr 1900hr
2200hr
================================================== ==========================
4654 Saniff A A A C A A A C
4437 Joey B C B C B C B C
4479 Elmer C C B C C C B C
4484 Garry C C A B C C A B
4509 Philip A C A B A C A B
4903 Siti A C A B A C A B
=> The above monthly data is from excel (staffproject.xls). It comes
with staff number, staff name and 1 month timeslot data (divided into
4 time slots for each day). Each time slot is equivalent to the 4
hours, 4 hours, 2 hours, 3 hours respectively. "A,B,C,D" represent
project code. My question is :

1. I have import te excel xls into access database. Using Access, How
do I calculate for Project A,B,C,d, how many man hours are used for
different project?


Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
3564
by: Bob | last post by:
I have recently joined a healthcare company where I am the solo programmer. I am going to be starting work on a project. The management has asked me to provide an estimate of hours I am going to...
5
6506
by: cvisal | last post by:
Hi all Im working on productivity calculations (Time calculations) and need some help in coding. Database Tool:MS-Access 2003. The general operator punch-in time is 5:30 AM and the punch-out...
12
14442
by: paii, Ron | last post by:
Sorry about that last one. Does anyone know how to calculate the width a string of text for given Font name and size? I want to buildup a block of text strings to display in a unbound control,...
1
7461
by: deena22 | last post by:
hello, i'm using 'Access database' and VB 6.0. My database is named ' timesheet' and it contains a table named 'tabletimesheet'. The table contain the following fields: 'staffname, stafftype,...
4
2998
by: NormAmst | last post by:
I have a list of CPU processing times and job durations for an entire department at work. There are 3 classifications I am maintaining. CPU time during peak hours , CPU time during non peak hours...
9
2463
by: brendanmcdonagh | last post by:
Hi, I am designing a project for my friend as I am just a week old baby to vb and want to implement what I've learnt so far. She wants to be able to put start time, end time and lunch for each...
3
14894
by: iceone | last post by:
Hi everybody, I am monitoring a call center and i need to calculate the working hours between the moment the call is answered and the moment the call is closed. i need to calculate the working...
15
6398
by: student4lifer | last post by:
Hello, I have 2 time fields dynamically generated in format "m/d/y H:m". Could someone show me a good function to calculate the time interval difference in minutes? I played with strtotime() but...
3
8397
by: lizBeth | last post by:
Hi all, i seem to have gotten stuck on this coursework, i am unsure as to how to implement a method in the main class to calculate the sum of all employees monthly salaries. Everything...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
432
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.