st*********@t-online.de (Wolfgang) wrote in message news:<b0**************************@posting.google. com>...
Hallo,
ich habe das Problem, dass es mir nicht gelingt, berechnete Zeiten
einer 24-Stunden Periode zu addieren. So kann ich z.B. einen täglichen
Abwesenheitszeitraum nicht zu einem Monatswert addieren. Ich habe es
schon mit DatTeil usw. versucht, wahrscheinlich mache ich etwas
falsch. Ich wäre sehr dankbar, wenn mir jemand einen Hinweis, Tipp
oder gar einen Lösungsweg zeigen könnte.
Freundliche Grüße
Wolfgang
<John Knapp> wrote (email):
Here is the approximate translation.
"I have the problem that I am not successful in adding up added times
within a 24 hour period. I cannot add up a daily absent time period to
a monthly value. I already tried DatTeil etc., I probably did
something wrong. I would appreciate if someone could give me a hint or
even a solution to my problem.
Kind regards
Wolfgang"
I hope this means something to you.
Using information posted by Robin Stoddart-Stones,
http://groups.google.com/groups?hl=e...net.com&rnum=3
tblAbsent:
EmployeeID Long
WorkDate Date
StartAbsence Text
EndAbsence Text
EmployeeID, WorkDate, StartAbsence, EndAbsence
1 08-Jul-04 12:00 13:00
1 08-Jul-04 17:00 20:00
1 09-Jul-04 12:00 1:00
1 09-Jul-04 16:30 20:30
2 08-Jul-04 14:00 15:00
SELECT Int(Sum(CDate([EndAbsence])-CDate([StartAbsence]))) AS Days,
Format(CDate(Sum(CDate([EndAbsence])-CDate([StartAbsence]))),'h:nn')
AS Hours FROM tblAbsent WHERE (((tblAbsent.WorkDate)=#7/8/2004#))
GROUP BY tblAbsent.EmployeeID HAVING (((tblAbsent.EmployeeID)=1));
==>
Days Hours
0 4:00
SELECT Int(Sum(CDate([EndAbsence])-CDate([StartAbsence]))) AS Days,
Format(CDate(Sum(CDate([EndAbsence])-CDate([StartAbsence]))),'h:nn')
AS Hours FROM tblAbsent WHERE (((tblAbsent.WorkDate)>=#7/8/2004# And
(tblAbsent.WorkDate)<=#7/9/2004#)) GROUP BY tblAbsent.EmployeeID
HAVING (((tblAbsent.EmployeeID)=1));
==>
Days Hours
0 9:00
The queries were untested for anything much beyond the sample shown.
James A. Fortune