Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP ON STORING MULTIPLE DATA

Status
Not open for further replies.

kingjjx

Programmer
Joined
Sep 18, 2001
Messages
181
Location
US
HI, I am trying to make a timesheet interface online. I dont exactly know how to store the data in the database.

The interface looks like this :

EMP. ID: [ ]
NAME: [ ]

PAYPERIOD: [ ]
DEPARTMENT: [ ]

HOURS WORKED:
M | T | W | TH | F | SAT | SUN
JOBCODE: [ ] | | | | | |
JOBCODE: [ ] | | | | | |
JOBCODE: [ ] | | | | | |


The database I created to store these has the follwoing fields:

EMPID | PAYPERIOD | DEPARTMENT | JOBCODE | M | T | W | TH | F | SAT | SUN



Can someone please tell me the best way to store the information in the database ? The thing that confuses me is that Each employee could have different job codes .. so monday it could be jobcode A, the tuesday jobcode B which would be on another row. but the emp id is only in 1 row. Im just kinda lost. Any help on how to do this project will be deeply appreciated.

thank you
 
I don't know if this is the best way, but here's how I did it. This is my table structure:

TimePersonID [this is employee id#]
TimeWeekEnding [week ending date]
TimeTodayIs [string of entries for each day]
TimeCode [could be department]
TimeClass [maintainence,development,R&D(may not need this)]
TimeRegular [self explanatory, I hope]
TimeOT
TimeDoubleOT

If I work 8 hours a day on one project each day, TimeTodayIs will contain a comma-delimited list of the 5 days that week, and the rest of the columns will contain a list of five elements(even if it's 0). If I work all 5 days on project XYZ, TimeCode would contain XYZ 5 times. See what I'm doing? Oh yes, the primary key is a combination key of TimePersonID and TimeWeekEnding. This took a lot of doing with arrays and lists to get it to work right. Any other help, let me know.
Calista :-X
Jedi Knight,
Champion of the Force
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top