Calculating Time/Pivot Charts

J

Jason

I am attempting to Calculate two time fields to receive a duration, But I am
not that experienced with Access 2003. I tried using a Sum function but that
didnt work, Can anyone help.

Also does anyone have a good tutorial on Pivot Charts? I am tryign to
determine how often an item is being used.
 
R

Rick B

To calculate two times to determine a duration, you'd use the DATEDIFF
feature. See the help files for the exact syntax.

For example...
DateDiff("n",[StartTimeField],[EndTimeField])


To display a lunch duration as HH:MM, you could use the following...
=(DateDiff("n",[StartLunch],[EndLunch]))\60 &
Format((DateDiff("n",[StartLunch],[EndLunch])) Mod 60,"\:00")
 
J

Jason

Ok, So that would that command go in the default value to get the Duration
for every record? for Example, heres what im trying to do.

Lost Comms Time - Regained Comms Time = Total HH:MM

(I am new to calculating in Access so step by step is EXTREMELY helpful)

Rick B said:
To calculate two times to determine a duration, you'd use the DATEDIFF
feature. See the help files for the exact syntax.

For example...
DateDiff("n",[StartTimeField],[EndTimeField])


To display a lunch duration as HH:MM, you could use the following...
=(DateDiff("n",[StartLunch],[EndLunch]))\60 &
Format((DateDiff("n",[StartLunch],[EndLunch])) Mod 60,"\:00")


--
Rick B



Jason said:
I am attempting to Calculate two time fields to receive a duration, But I
am
not that experienced with Access 2003. I tried using a Sum function but
that
didnt work, Can anyone help.

Also does anyone have a good tutorial on Pivot Charts? I am tryign to
determine how often an item is being used.
 
J

John Vinson

Ok, So that would that command go in the default value to get the Duration
for every record? for Example, heres what im trying to do.

Lost Comms Time - Regained Comms Time = Total HH:MM

First off: an Access table IS NOT A SPREADSHEET.

The logical structure of a database is completely different than that
of a spreadsheet. In particular, Tables should not store derived data
at all - so you cannot and should not put this field in any Table.

Instead create a Query based on your Table. In a vacant Field cell in
the table, call the DateDiff function as suggested:

TotalTime: DateDiff("n", [Regained Comms Time], [Lost Comms Time])

This will give you an integer number of minutes between the two time
fields.

John W. Vinson[MVP]
 
Top