[thelist] storing dates in MySQL

Mike evolt at muinar.com
Tue Aug 10 15:18:31 CDT 2004


At 14:40 10.08.2004 -0400, you wrote:
>hi all! i'm currently designing a web based timesheet application for my 
>company and i've got a question on what would be the best method to 
>accomplish the following.
>
>every two weeks, i need to generate new timesheets for everyone. in the 
>database for each person's timesheet, i have a 'dateStart' field to denote 
>this. but how should i represent and generate this value?

Hi Ted

Basically, you could count the weeks since the start date for your
co-worker, then add the highest possible even number of weeks to the
start date - there you have the date when your current timesheet begins.

If you have some sort of navigation, you could loop through the
timesheets printing the start date and then a link every two weeks after
that, until the date exceeds today.

And for every timesheet, you select the entries which are between these
two weeks from the DB...

Makes sense?

Mike



More information about the thelist mailing list