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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Production Time Expression

Status
Not open for further replies.

ThatNewGuy

Technical User
Jan 19, 2007
47
US
I'm trying to build a production time expression for a report. My end goal is to obtain a production time number in hours. Everyone knows how much fun it is to work with time and dates in Access.

Anyways what I have so far is this =[quantity]*[pages]/(7000)*(60) It's currently taking a quantity 1,5000 x number of pages 45 and dividing that total number by a coefficient of 7000. Which in this example would equal 9.64 hours. The problem is the .64 is really 38 minutes after you x by 60(minutes) so your total should really be 9 hrs and 38 minutes not 9.64. How do you apply the 60 minute calculation only to the decimal points so the end factor is 9.38 real time and not the 9.64.

Example, 1,500 x 45 = 67,500/7,000 = 9.64 x the .64 by 60 to adjust for time so end result is 9.38.
 


Hi,

Convert your time (ie 9.64 hrs) to days and then use the Format function to return hh:mm.
Code:
    t = 9.64
    MsgBox Format(t / 24, "hh:mm")

Skip,

[glasses] [red][/red]
[tongue]
 

Hey Thatnewguy,

Time questions have been a mainstay here for some, er, time.

Search the FAQ/Fora and I'll bet you find an answer really fast.

The main thing to remember is that times/dates are recorded as NUMBERS. They must be dealt with as such. Data OUTPUT is simply a matter of formatting.

Best of luck - post again with any additional problems!
Don

[green]Tis far easier to keep your duck in a row if you just have the one.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top