Calculating total... in Query or Form

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

Guest

Ok, this should be an easy but I can't seem to figure it out...

Working with a query that pulls the following fields:
Date Time Length
9/22/2007 9:38:00 PM 1
9/22/2007 9:40:00 PM 5
9/22/2007 9:41:00 PM 2

All I am trying to do is calculate the total of the all entries in the
"Length" field... just like in Excel... can do it either in a Query or Form.

Any help would be appreciated!
Thx
 
To do it in a query you need to exclude the 'Time' field, select View/Totals
when in design view and change the Length column 'Groupby' to 'Sum'. That
will group all records by date and show the sum of all Length values for that
date.

In a form (continuous view) you can place an unbound textbox in the Footer
section and set its ControlSource to =Sum(Length). If necessary, you may need
to filter your form by date. This way, you will be able to see the individual
'Time' values too.

You can also do this using a form in Datasheet view. In this case, you would
need to make it a subform. You could then use the parent form to select the
date to show in the subform. A form in Datasheet view will not show the
calculated field that you create in the footer but you can place an unbound
textbox on your parent form and reference the invisible calculated control on
your subform to get its value.

Steve
 
Back
Top