URGENT - How to convert this decimal values into hours?

G

Guest

Hi. I'm having some problems in converting decimal values into hours.

Sometimes my decimal values are less then 1, that means that the hours are
less then 24h but sometimes my values are 2.5 that means that is two days and
half.

How can I convert this values:

This is what I have This is what I need
3,416666667 82:00:00
8,604166667 206:30:00
0,395833333 9:30:00
4,375 105:00:00
2,0625 49:30:00
4,770833333 114:30:00
0,125 3:00:00
3,291666667 79:00:00


I using this 4 formulas: (but without results)
1 - FixHoras24: CInt([sumofValorDecimal]*24)
2 - FixHoras: CInt([sumofValorDecimal])
3 - FixMinutos: ([sumofValorDecimal]-[FixHoras])
4 - TotalHoras: CInt([FixHoras24]) & Format(([FixMinutos]);"\:nn")

If I change CInt to Int or Fix the result is one hour more or less.

Please help me here.

Regards,
Marco
 
G

Guest

THANK YOU

Michel Walsh said:
Int(24 * x) & Format( x, ":nn:ss" )


should do.


Vanderghast, Access MVP



Marco said:
Hi. I'm having some problems in converting decimal values into hours.

Sometimes my decimal values are less then 1, that means that the hours are
less then 24h but sometimes my values are 2.5 that means that is two days
and
half.

How can I convert this values:

This is what I have This is what I need
3,416666667 82:00:00
8,604166667 206:30:00
0,395833333 9:30:00
4,375 105:00:00
2,0625 49:30:00
4,770833333 114:30:00
0,125 3:00:00
3,291666667 79:00:00


I using this 4 formulas: (but without results)
1 - FixHoras24: CInt([sumofValorDecimal]*24)
2 - FixHoras: CInt([sumofValorDecimal])
3 - FixMinutos: ([sumofValorDecimal]-[FixHoras])
4 - TotalHoras: CInt([FixHoras24]) & Format(([FixMinutos]);"\:nn")

If I change CInt to Int or Fix the result is one hour more or less.

Please help me here.

Regards,
Marco
 

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