Calculating Hours Minutes from Decimal

Jamie

New member
Local time
Today, 09:10
Joined
Sep 27, 2011
Messages
9
I'm working on a utilization database and pulling Excel data from Cognos 8. I use Access formulas to separate hours and minutes because I want to use time (.30, .45 (minutes)) instead of quarterly increments (.25, .50). I've successfully segregated hours, because I also have to turn days into hours. When I try to calculate out a column just for minutes, my formula keeps the number of days and I don't know how to fix it so the column just shows the minutes. An example is a job has a decimal time of 2.02083333, which when done correctly is 48 hours and 30 minutes. I get the 48 hours correct, but the minutes shows as 2.30 instead of 0.30. That inflates the total job time to 50.30. This is the calculation currently in my database to pull out minutes: Minutes: Int(([Min]\60)\24) & "." & Format([Min] Mod 60,"00").

How do I get rid of the '2' in the 2.30?

Thanks! Access 2010
 
Everything in that first paragraph is really confusing. I did however understand your second paragraph:

How do I get rid of the '2' in the 2.30?

The answer to that is:

DecimalPortion: [FieldName]-CInt([FieldName])

But it only works for positive values. If you need to process negative numbers, it would need a little work.
 
The decimal part is always Positive regardless of the sign of everything before the decimal point.

Hence -1.5 is 12 hours before Midnight 12/30/1900 (I may have the date wrong. It could be a year earlier)
 

Users who are viewing this thread

Back
Top Bottom