Time calculation

  • Thread starter Thread starter Gerfield
  • Start date Start date
G

Gerfield

Hi Guys,

I have a table which is imported from a text file containing data related to
telephone calls including the Duration of these calls in hh.mm.ss format. I
need to be able to show this data in a form(or report) and include a Total
of this Duration time preferable at the bottom of the form. I have been able
to create the form, easy stuff, but I am having trouble figuring out how to
calculte a total for the time. Can anyone explain hoe this can be done? I
have experimented with =SUM in a text box in the footer of the form but
can't get the correct formula figure out. Any help is greatly appreciated!
 
George, thanks for that extremly quick response!
Please forgive my ignorance but I am a little lost as to how and where to
impliment this TimeValue to convert the text to time. Also, how will I then
be able to show the total of this column?
 
TimeValue("14:56:45")
will convert your text values into a numerical value that you could then
Sum.

HTH,
 
Please see your OTHER post in the OTHER newsgroup.

In the future, please do not post to multiple groups. It means that people
spend time answering your question only to find that it might already have
been answered in another group.
 
If the duration is already showing correctly in the form, you can probably
leave it as is (assuming it is not editable).
If not, add a textbox and put
= TimeValue([MyDuration])
in its Control Source property. Format control as desired.

In either case: GrandTotal: Add a textbox to the Control Footer. Put
= Sum(TimeValue([MyDuration]))
in it's ControlSource property.

In the above, MyDuration is a field name. If that field is already displayed
on the form and if you used a wizard to create the form, the Control may
have the same name as the Field. This will cause #Name errors when you try
to use the Field name in a formula. Change the Name of that control to
something else (i.e., txtMyDuration). Then Access will know you intend to
reference the Field in the formulas, not the Control and the #Name errors
will go away.

HTH,
 
Thanks George, that seems to have worked as I wanted! Thank you very much,
this was giving me way too much grey hair trying to figure out!!!

George Nicholson said:
If the duration is already showing correctly in the form, you can probably
leave it as is (assuming it is not editable).
If not, add a textbox and put
= TimeValue([MyDuration])
in its Control Source property. Format control as desired.

In either case: GrandTotal: Add a textbox to the Control Footer. Put
= Sum(TimeValue([MyDuration]))
in it's ControlSource property.

In the above, MyDuration is a field name. If that field is already
displayed on the form and if you used a wizard to create the form, the
Control may have the same name as the Field. This will cause #Name errors
when you try to use the Field name in a formula. Change the Name of that
control to something else (i.e., txtMyDuration). Then Access will know you
intend to reference the Field in the formulas, not the Control and the
#Name errors will go away.

HTH,
--
George Nicholson

Remove 'Junk' from return address.



Gerfield said:
George, thanks for that extremly quick response!
Please forgive my ignorance but I am a little lost as to how and where to
impliment this TimeValue to convert the text to time. Also, how will I
then be able to show the total of this column?
 
Back
Top