I would disagree with Fred's assessment. His design assumes there
could be only one hold during any session. If that's the case, then
Fred's design would suffice.
I would recommend the following tables:
tblCall
--CalIDl(pk)
--Subject
tblActivity
--CallID(fk)
--TimeStamp
(You will need many more fields, but the above are required to
calculate your call time.)
and the following Form:
frmCall
source=tblCall
combox cbxCall
source=tblCall
commandbutton cmbButton1(.caption = "Start")
comanndbutton cmbButton2 (.caption = "Pause")
OPTIONAL subform sfrmActivity
source tblActivity where tbxCallID = tblCallID
cmbButton1_onClick
if cmbButton1.caption = "Start" then
add record to tblActivity (CallID,NOW()*-1)
change cmbButton1.caption to "STOP"
else:
add record to tblActivity (CallID,NOW())
change cmbButton1.caption to "START"
end if
cmbButton2_onClick
if cmbButton2.caption = "Pause" then
add record to tblActivity (CallID,NOW())
change cmbButton2.caption to "RESUME"
else:
add record to tblActivity (CallID,NOW()*-1)
change cmbButton2.caption to "PAUSE"
end if
(You would need to add additional button control to prevent a Start
for a call already started, or a resume without a pause, etc.)
The idea of the negative time entries allows a summation query to
calculate the total call length by summing the time stamps. I don't
know that you can use Now()*-1 directly. You might have to use the
serial value and convert back and forth. (I recommend saving the Now()
value in the table. Don't save any calculated or derived values.)
No limit to the number of pauses during a call. A call could even be
restarted.
Hope this helps
hello all,
I want to look how long people are working on a call.
I want to do this on the following way;
the call is pending (start time)
the call is on hold (stop counting the working time)
the call is pending again (start time)
I want to see how long they are really working on the call, without the time
that the call is on hold.
Is someone who can help me?
Best regards,
Rogier
You need 4 separate fields:
[CallStart], [CallPause],[CallResume] and [CallEnd]
Then, (untested Air Code) ... to calculate the elapsed active time
(in minutes) in a query:
ActiveTime
ateDiff("n",[CallStart],[CallEnd])-IIf(Not
IsNull([CallPause]),DateDiff("n",[CallPause],[CallResume]),0)
Note: Each of the above fields should include the Date and Time, not
just the Time.
Of course, the [ActiveTime] value ought not be saved in any table.
Anytime you need the ActiveTime, recalculate it, as above.
THANKS!
David G.
.