| re: Problem on a report..,?
"christian" <csepulveda@partners.org> wrote in message
news:e1cc3cc3.0407120543.4e8f8369@posting.google.c om...[color=blue]
> Hi everyone!
>
> I've been trying to add some Date/time fields in a report:
>
> I've a Text Box on the report footer that says:
>
> Worked**=Sum([WorkedHours])
>
> The Problem is that when an Employee works more than 24:00 hours, the
> value goes back to 00:00. for Instance when someone works 23:59 it
> calculates fine, but if the person works more than 24:00 hours, the
> value goes 00:00.
>
> Is there anyway that I can fix this??[/color]
Access DateTime fields are for storing "points in time", not "amounts of
time". It might be your intention that an entry of 12:15 means 12 hours
and 15 minutes, but to Access it represents 12:15 PM on December 30, 1899.
When you add 12 hours to it you end up at 15 minutes past midnight on
December 31, 1899.
The best way to deal with this is to store a DateTime as a starting point,
another as an ending point, and then use DateDiff to calculate the
difference in whatever is the lowest increment you care about (say minutes
for example). Then your report can sum the minutes which can easily be
converted back to hours and minutes for display.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com |