Totaling up the hours

  • Thread starter Thread starter Ginger
  • Start date Start date
G

Ginger

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?
 
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
 
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?
.
.
 
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?
.
.
.
 
It works Terry.

Many, many thanks.
-----Original Message-----
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?
.

.
.
.
 
Back
Top