Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding hours more than 24

Status
Not open for further replies.

koie

Technical User
Feb 25, 2004
8
US
I have been spending hours on searching the topics on how to display the amount of hours correctly in my reports.
Instead of 21:00 + 7:00 = 04:00 I want to display 28:00 or 1 day 4 hrs.
I know now that this is a familiar problem in Access but somehow I cannot seem to get it to work.

I have in the controlsource of a text field in my header section the report

=Sum(qryDurationTimeAnalysis![ANALYSIS TIME])

It is summing all the individual times for a lab analysis.
When the sum is more than 24 hrs the time is displayed wrong.

I have been trying several things in the expressionbuilder to show the time right but unfortunately without succes.

Either showing it like [1 day(s) 4 hour(s) 0 min] or [28 hour(s) 0 min] would be just fine.

Any suggestions would be grately appreciated.

Remko
 
Try an expression like:
cInt(AnalysisTime*24) & " Hour(s) " & Format(AnalysisTime,"nn") & " Minute(s)"

DateTime fields are meant to store a point in time rather than a duration.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
This topic has been severally discussed in these (Tek-tips) fora. Use Advanced Search (possible) Key Word Term ~~ 24 Hr, or variations. You should recieve HUNDREDS of responses, several f which give a variety of examples / situations as well as addittional references. See ALSO the ubiquitous {F1} (aka HELP), topis / Keyword FORMAT. some where in the sample formats a (more or less) direct way to this is presented.





MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top