Home
What is MS Access
Tables
Forms
Queries
Reports
VBA Codes
Learn VBA
Access 2007/10
Access 97
Tips via email
Whats New!
Contact Me
Questions Answered

[?] Subscribe To This Site

XML RSS
Add to Google
Add to My Yahoo!
Add to My MSN
Subscribe with Bloglines

Adding Times

Adding Times



This tip on Adding Times is suitable for all versions of Microsoft Access.

This tip explains how to add time fields together, when the sum of the fields is greater than 24 hours.

It uses two scenarios.

The first is adding two different fields together either in a query, a form or a report.

The second is summing all the values in the one field, i.e. either in a continuous form or on a report.

The syntax changes slightly depending on whether the calculation is in a query a form or a report.

Note: Change the [TimeExample] fields to the name of your fields.

This first one is the adding of two time fields:

Query Example

The following would be entered into the first row of the a blank column in the query.

SumTime: Format(([TimeExamples]+[TimeExamples1])*24,"#.0" & " Hours")

Form or Report Example:

Add an unbound text box to a form or a report and enter the following within this text box.

=Format(([TimeExamples]+[TimeExamples1])*24,"#.0" & " Hours")

This second scenario is if you wish to sum all the values in the one field, i.e. for either a continuous form or in a report.

To do this:

Add an unbound text box to the form or the report.

In a continuous form you would normally (but not always) put this in the form footer.

On a report you would normally (but not always) put this in the footer of the section of a grouped report where the field is you would like to add together.

To this unbound text box add the following formula:

=Format(Sum([TimeExamples])*24,"#.0") & " Hours"

These formats will display the result as: 136.8 hours. The results are rounded and the final part is in decimals, so you may wish to change these back to minutes, depending on what you are going to do with the result.




Return from Adding Times to Simply Access Home Page


or

Return to Microsoft Access Forms

or

Return to Microsoft Access Reports

or

Return to Microsoft Access Queries


Search Simply Access

Custom Search


Want to learn more for free.

Sign up for Simply Access 'Microsoft Access Tips'. Free useable tips to your in-box each month.

Enter your E-mail Address
Enter your First Name (optional)
Then

Don't worry -- your e-mail address is totally secure.
I promise to use it only to send you Microsoft Access Tips.



If you wish to learn VBA to expand the possibilities of Microsoft Access then

Click Here Just $7.95 for 56 lessons.