Summing Times

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I think i have the math right, but i am stuck now. I have a query which
calculates the elapsed time that a student puts in a given activity on a
given day. I have:

total time:=[End Time] - [Start Time]

Now I want to sum the totals in a report grouping footer. When i use
:=Sum([Total]) I get an error message that says i must define a Sort Field
or Expression in the form i am trying to preview.

Please help
 
Dan said:
I think i have the math right, but i am stuck now. I have a query
which calculates the elapsed time that a student puts in a given
activity on a given day. I have:

total time:=[End Time] - [Start Time]

Now I want to sum the totals in a report grouping footer. When i use
:=Sum([Total]) I get an error message that says i must define a Sort
Field or Expression in the form i am trying to preview.

Please help

=Sum([End Time] - [Start Time])

You sum "fields" not "controls".
 
Yeah it was an unrelated error. I fixed the Sort Eror Message, but I still
have a problem Summing times. I have my times totaled, but I cannot get sum
to be formatted in hours and minutes.

Rick Brandt said:
Dan said:
I think i have the math right, but i am stuck now. I have a query
which calculates the elapsed time that a student puts in a given
activity on a given day. I have:

total time:=[End Time] - [Start Time]

Now I want to sum the totals in a report grouping footer. When i use
:=Sum([Total]) I get an error message that says i must define a Sort
Field or Expression in the form i am trying to preview.

Please help

=Sum([End Time] - [Start Time])

You sum "fields" not "controls".
 
Consider summing the minutes like:
=Sum(DateDiff("n", [Start Time], [End Time]) )
If you want hours, divide the summed minutes by 60.
--
Duane Hookom
MS Access MVP


Dan Robles said:
Yeah it was an unrelated error. I fixed the Sort Eror Message, but I
still
have a problem Summing times. I have my times totaled, but I cannot get
sum
to be formatted in hours and minutes.

Rick Brandt said:
Dan said:
I think i have the math right, but i am stuck now. I have a query
which calculates the elapsed time that a student puts in a given
activity on a given day. I have:

total time:=[End Time] - [Start Time]

Now I want to sum the totals in a report grouping footer. When i use
:=Sum([Total]) I get an error message that says i must define a Sort
Field or Expression in the form i am trying to preview.

Please help

=Sum([End Time] - [Start Time])

You sum "fields" not "controls".
 
To expand a bit on Mr. Hookom's response to give you a display of hours and minutes

=Sum(DateDiff("n", [Start Time], [End Time]))\60 & ":" &
Format(Sum(DateDiff("n", [Start Time], [End Time])) Mod 60,"00")


Duane said:
Consider summing the minutes like:
=Sum(DateDiff("n", [Start Time], [End Time]) )
If you want hours, divide the summed minutes by 60.
--
Duane Hookom
MS Access MVP

Dan Robles said:
Yeah it was an unrelated error. I fixed the Sort Eror Message, but I
still
have a problem Summing times. I have my times totaled, but I cannot get
sum
to be formatted in hours and minutes.

Rick Brandt said:
Dan Robles wrote:
I think i have the math right, but i am stuck now. I have a query
which calculates the elapsed time that a student puts in a given
activity on a given day. I have:

total time:=[End Time] - [Start Time]

Now I want to sum the totals in a report grouping footer. When i use
:=Sum([Total]) I get an error message that says i must define a Sort
Field or Expression in the form i am trying to preview.

Please help

=Sum([End Time] - [Start Time])

You sum "fields" not "controls".
 
Thanks Gents. a quick follow up though, will this allow mw to sum past 24
hours?
I need a running total over a school year.

Dan

John Spencer said:
To expand a bit on Mr. Hookom's response to give you a display of hours and minutes

=Sum(DateDiff("n", [Start Time], [End Time]))\60 & ":" &
Format(Sum(DateDiff("n", [Start Time], [End Time])) Mod 60,"00")


Duane said:
Consider summing the minutes like:
=Sum(DateDiff("n", [Start Time], [End Time]) )
If you want hours, divide the summed minutes by 60.
--
Duane Hookom
MS Access MVP

Dan Robles said:
Yeah it was an unrelated error. I fixed the Sort Eror Message, but I
still
have a problem Summing times. I have my times totaled, but I cannot get
sum
to be formatted in hours and minutes.

:

Dan Robles wrote:
I think i have the math right, but i am stuck now. I have a query
which calculates the elapsed time that a student puts in a given
activity on a given day. I have:

total time:=[End Time] - [Start Time]

Now I want to sum the totals in a report grouping footer. When i use
:=Sum([Total]) I get an error message that says i must define a Sort
Field or Expression in the form i am trying to preview.

Please help

=Sum([End Time] - [Start Time])

You sum "fields" not "controls".
 
Did you try it?

--
Duane Hookom
MS Access MVP


Dan Robles said:
Thanks Gents. a quick follow up though, will this allow mw to sum past 24
hours?
I need a running total over a school year.

Dan

John Spencer said:
To expand a bit on Mr. Hookom's response to give you a display of hours
and minutes

=Sum(DateDiff("n", [Start Time], [End Time]))\60 & ":" &
Format(Sum(DateDiff("n", [Start Time], [End Time])) Mod 60,"00")


Duane said:
Consider summing the minutes like:
=Sum(DateDiff("n", [Start Time], [End Time]) )
If you want hours, divide the summed minutes by 60.
--
Duane Hookom
MS Access MVP

Yeah it was an unrelated error. I fixed the Sort Eror Message, but I
still
have a problem Summing times. I have my times totaled, but I cannot
get
sum
to be formatted in hours and minutes.

:

Dan Robles wrote:
I think i have the math right, but i am stuck now. I have a query
which calculates the elapsed time that a student puts in a given
activity on a given day. I have:

total time:=[End Time] - [Start Time]

Now I want to sum the totals in a report grouping footer. When i
use
:=Sum([Total]) I get an error message that says i must define a
Sort
Field or Expression in the form i am trying to preview.

Please help

=Sum([End Time] - [Start Time])

You sum "fields" not "controls".
 
Back
Top