Date and hours

DevAccess

Registered User.
Local time
Yesterday, 19:09
Joined
Jun 27, 2016
Messages
321
Hello

I would like to build a system which would allow to enter the current week hours for the logged in user for example... 12th Dec to 18th Dec

and then user can put the hours against each day in the form may be datasheet view or field wise display or input entries...

Also I would like to store the previous week entries they have not entered any data for example if in previous week 5th Dec -11th Dec 2016 they have not entered any time for any day/date they can goto combobox and click on that perticular week and can enter that.

When they loggin they should see current week data input entry..

when we save this we would like to save this as one week per one user record, one user could have multple week entries.

Thanks
 
you need a table to capture
PersonID
StartDate
EndDate

The 2 date fields are Date/time so the hours can be calculated
 
If the users are just going to enter the hours per day without any computation being done to arrive at that figure then I say you table structure would simply be:

PersonID
WorkDate
Hours

I believe this would be the normalized structure; however, to implement a user interface that allows them to add the hours for a full week in a datasheet view you have to use a temporary table for the user interface and ferry values back and forth to the real table in code.

If you deviate from normal form and have a structure like:

PersonId
WeekStartDate or WeekNumber
WeekDay1Hours
WeekDay2Hours
WeekDay3Hours
WeekDay4Hours
WeekDay5Hours
WeekDay6Hours
WeekDay7Hours

it would make the implementation of the user interface easier but it could bite you in the ass when to try to extract data from it. For example consider the query that summaries the hours per person between two dates. If the data is normalized this query takes about five minutes to create. For the alternate structure I suspect you would be spending all day on it and perhaps weeks if you need to rely on this forum.
 

Users who are viewing this thread

Back
Top Bottom