Totaling up the hours

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Terry (anonymous_at_discussions.microsoft.com)
Date: 04/08/04


Date: Wed, 7 Apr 2004 22:18:56 -0700

Ginger,

I didn't test my response (till now).

To get around this

=sum(format([TimeDifferenceField],"0.00"))*24&" hours"

This will format the timedifferencefield into a normal
number and allow sum and multiplication operations to be
performed.

I hope this works a bit better for you.

Terry

>-----Original Message-----
>Hi,
>
>I tried doing that but it keeps on giving me error
>message " Data type mismatch". I use both the formulas
>with the same result.
>
>Fyi, my data type for StartTime and EndTime are set to
>Date/Time. My formula for Time Difference on the query is
>DiffTime: Format([StartTime]-[EndTime],"Short Time").
>
>Can you pls advice?
>
>Thanks.
>
>Regards
>Sze Mei
>
>
>>-----Original Message-----
>>Ginger,
>>
>>In the report footer (or an appropriate group footer)
put
>>a control and set it's control source to =sum
>>([TimeDifferenceField]). If the totals are less than 24
>>hours you can probably get away with formating the
>control
>>to display hours. If you are after "larger" quantities
of
>>hours you will need to massage the result.
>>eg. =format(sum([TimeDifferenceField])*24,"0.00")&"
hours"
>>This will convert the fractional measure of hours to a
>>unit per hour and give you two decimal places. The
result
>>should look something like 145.46 hours.
>>
>>hth,
>>
>>Terry
>>
>>>-----Original Message-----
>>>I have two fields, i.e. StartTime and EndTime.
>>>I calculated the difference between those two times on
>>>Query.
>>>
>>>Now, I would like to do a total for the time
differences
>>>on the report. I'm not sure how.
>>>
>>>Can somebody help me?
>>>.
>>>
>>.
>>
>.
>



Relevant Pages

  • Difference between date and times
    ... I have a problem which I know can be sorted out easily but my mind has ... I have four columns showing dates and times. ... Dates are in the format of dd/mm/yyyy and times are in the format of ... The actual time difference is 8 hrs and 16 mins; but the way I have it ...
    (microsoft.public.excel.misc)
  • Re: Calculating Date AND Time Differences
    ... Format the cell as GENERAL for a return of 29. ... the time difference between 8am on the 20th March and 1pm ... I have driven the Paper Slide help function crazy by asking in numerous ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Difference between date and times
    ... I have four columns showing dates and times. ... Dates are in the format of dd/mm/yyyy and times are in the format of ... The actual time difference is 8 hrs and 16 mins; but the way I have it ...
    (microsoft.public.excel.misc)
  • Re: Excel Date & Time values problem
    ... then format as mm/dd/yyyy hh:mm ... > calculate the time difference. ... > Now as you can see I have to subtract Col3 from Col1&2 combined. ...
    (microsoft.public.excel.misc)
  • Re: I thought I COULD sum fields from my data source?
    ... CSOUSA wrote: ... Now all I want to do in my report footer is =Sum. ... Also, when you format a value, the result is a text string, ... MVP ...
    (microsoft.public.access.reports)