Re: Time keeping in DB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



as I said, the job is to store a time sheet.
u came up with:

1. One record for each 7 day week (year, week_num, d1, d2, d3, d4, d5,
d6, d7) where the dX field holds the hours worked
2. One record for each day (date, hours)

it seems that just the first record is fine. in a data design u dont hold
the same data twice. so why to use the second record?

if u want to use two tables, then the d1-d7 fields should not be in that
record.
if u use the second record it could be that there are two records with the
same date, what to do with it?, whichone is valid? date-time field are a bit
complicated and it is not a good idear to do them unique, that is because
internally those field are stored in databases as long unsigned integer
often the passed seconds since 1982 (the birth of the ibm pc) or even
miliseconds. that means there is always internally a big juggling to format
the date.

Ralph
<ralph_deffke@xxxxxxxx>

"Shawn McKenzie" <nospam@xxxxxxxxxxxxx> wrote in message
news:E9.66.14714.5B80A7A4@xxxxxxxxxxxxxxx
> Ben Dunlap wrote:
> >> sorry man, but a good data design keeps only data in a table u can not
> >> calculate. in ur case that would be only <date> <start> and <end> time.
> >> refernces to user and project/tasks in other tables.
> >>
> >> ur time sheet is definately a job for a report. that type of design
limits u
> >> to nothing. a user can start ans stop as many times he wants a day or
time
> >> range. u can report any number of time bits to any number of project a
day
> >> or time range
> >
> > I agree (unless the app just doesn't have access to the start/stop
data).
> >
> > Ben
>
> OK, I think I understand most points except the start and stop time.
> Every time sheet I have used, SAP and several other smaller ones, I
> enter a weeks worth of time data like:
>
> Project Sun Mon Tues Wed Thur Fri Sat
> -------------------------------------------------------------------
> Grill steaks 8 8 8 8 0
> Vacation 0 0 0 0 8
>
> So why wouldn't I store the dates and the hours instead of start and
> stop times?
>
> -- 
> Thanks!
> -Shawn
> http://www.spidean.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux