Microsoft KB Archive/100141

INF: How to Use TimeValue to Calculate Difference in Times

PSS ID Number: Q100141 Article last modified on 03-13-1995

1.00 1.10 2.00

WINDOWS

= SUMMARY =

This article describes how to use the TimeValue function to find the difference between two values that have Date/Time data types and that occur within a 24-hour period.

= MORE INFORMATION =

To set up an example that uses the TimeValue function, create a form with the following text boxes:

To calculate the difference between the times in these two fields, create a third text box with the following properties:

NOTE: In the following sample code, an underscore (_) is used as a line-continuation character. Remove the underscore when re-creating this code.

Note that in the example above, the Format function is used to format the time difference. Short Time displays the difference in hours and minutes.

= REFERENCES =

For more information on formatting values, search for “format” then “format, format$” using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 KBCategory: kbprg KBSubcategory: PgmOthr

=
================================================================

Copyright Microsoft Corporation 1995.