Converting Time to Format That Items Per Hour Can Be Calculated

P

py@wfc

I have a table with fields named Date, Items, StartTime(formatted ShortTime),
and StopTime(formatted). I have found a query that calculates the duration
of time using the expression Format([StartTime]-1-[StopTime],"Short Time").
This works very well as it calculates time over a 24 hour clock and between
dates.

My next task is to calculate items per hour but since the time is not
formatted numerically the simple calculation of [Items]/[Hours] won't work
and returns an error. How can I get the duration formatted to work in the
item per hour calculations?
 
V

Van T. Dinh

Use CDate() on your expression to convert it back to (date)time value from
String.

(Note: result of Format() is a Variant of String type.)
 
Top