Hi kimla10,
Although it can be done in Word, Excel is a far better tool for this.
And, in Word, a macro is probably going to give you a better
solution than a field code. Here's some code recently posted recently
by Jay Freedman, another Microsoft Word MVP:
Sub demo()
Dim startTime As Date, endTime As Date
Dim diffHr As Long, diffMin As Long
startTime = CDate("8:00 am")
endTime = CDate("12:35 pm")
diffMin = Abs(DateDiff("n", startTime, endTime))
diffHr = Int(diffMin / 60) ' truncated to whole hours
diffMin = diffMin Mod 60 ' remaining minutes
MsgBox diffHr & ":" & diffMin
End Sub
To make this work in your table, you'd need to get the startTime &
endTime from formfields with their properties set to run the
macro on exit, then output the result to another field instead of to
the message box.
Having said all the above, if you *really* want to go down the field
code route, you can how to do this and just about everything
else you might want to do with dates in Word, check out my Date Calc
'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902
or
http://www.gmayor.com/downloads.htm#Third_party
Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------
"kimla10"
[email protected] wrote in message
How do i calculate time ; hours worked ? I am trying to find a field
code
formula in a Word table and then to minus that by 0.30? I have
designed a
Timesheet but want to calculate daily hours then minus it by lunch
break.
Can anyone help?
I have seen time calculations but i can't find time as in hours
worked. -