Conditional Averages

M

Matt

I am developing a tracking database that will deliver a report which will
tell if a document is on time or late. I would like to calculate the Average
time for those items that are marked late.

I used an IIf statement which reads:
IIf([Early or Late]="Late", Avg([Total Time Early or Late]), "Item is on
time")

[Total Time Early or Late] is a calculated field that returns the difference
in two General Dates in the following format: "XXdays XXhrs XXmins" using the
code on this web page: (http://www.accessmvp.com/djsteele/Diff2Dates.html)

I would like my IIf statement to be formatted in the same manner. Any ideas
how I would accomplish this?

Right now the answer is returned in a number format (i.e. 7.1116)

Thanks
 
M

Matt

Re-submit of earlier question....

I am developing a tracking database that will deliver a report which will
tell if a document is on time or late. I would like to calculate the Average
time for those items that are marked "Late".

I used an IIf statement which reads:
IIf([Early or Late]="Late", Avg([Total Time Early or Late]), "Item is on
time")

[Total Time Early or Late] is a calculated field that returns the difference
in two General Dates in the following format: "XXdays XXhrs XXmins" using
the
code on this web page: (http://www.accessmvp.com/djsteele/Diff2Dates.html)

I would like the output of my IIf statement to be formatted in the same
manner:

Average Days Late: "2 days, 4 hrs, 13 mins"

Any idea how I would accomplish this?

Right now the answer is returned in a general number format (i.e. 2.818)
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top