I work with dates and times a lot and I found that I always have trouble if
I use date functions.
The first thing I would do is to convert them to standard long integers and
then it is just a matter of + or -.....
In the end you then display/format the date/time as the desired date/time
again...
in most cases that works much easier.
Let me know how you get on
"christian" <csepulveda@partners.org> wrote in message
news:e1cc3cc3.0405100528.63f80906@posting.google.c om...[color=blue]
> Hi all,
>
> I've been trying to add the following values in a form, but I don't
> know how to do it:
>
> Start Stop WorkedHours SET UET Other Time TotalHours
> 08:00PM 04:00PM 8:00 05:00 08:00
>
> The DataType of these fields are:
> Start: Date/time
> Stop: Date/time
> WorkedHours: TEXT
> SET,UET,OtherTime,TotalHours: TEXT
>
>
> The problem is that when the employee enter, for instance, in the SET
> field: 05:00. I want this field to add up to Totalhours,the same thing
> with UET,Other Time..
> I tried to change the datatype of these fields to Date/Time, but
> when I choose the input mask 00:00, I end up having 00:00AM, and I
> don't really want that. The start and stop, works fine...
> I've been working on this for a very long time, and I haven't be able
> to find out the function..here is the Function that I am currently
> using for Start and Stop fields.
>
> Dim Intintervalminutes As Integer
> Intintervalminutes = DateDiff("n", Me.Start, Me.Stop)
> Me.totalHours = Intintervalminutes \ 60 & Format(Intintervalminutes
> Mod 60, "\:00")
> Me.TotalHours = Me.WorkedHours
> Me.WorkedHours = Me.TotalHours
>
>
> Thanks in advanced..[/color]
---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004