Convert hours & minutes to minutes

skwilliams

Registered User.
Local time
Today, 03:52
Joined
Jan 18, 2002
Messages
516
How can I convert hours and minutes to minutes as an Integer?

For example, convert 2:15 to 135.

Any help is greatly appreciated.
 
Number of hours * 60 then add the minutes...

(2*60) + 15 = 135
 
The problem is the original format of this field is hh:nn but the conversion is to a Integer field.

For example:

2:15 converted to 135.
 
Well if the field is a text field (I'm guessing it is) then you would need to take the number left of the semi-colon ":" and multiply it by 60, then add the number right of the semi-colon to that. Check out the Left, Right and Instr functions to do this; if this result is going to be in the same table you would need to add a new column and place the results there, if it is in a new table then you can just append / update.
 
I found that I could do it like this.

Minutes: Hour(TimeDiff)*60+Minutes(TimeDiff)


Thanks for the help!
 
I found that I could do it like this.

Minutes: Hour(TimeDiff)*60+Minutes(TimeDiff)


Thanks for the help!

hi Skwilliams can you share to me how you solve this problem???

Hope to hear from you...

Thanks
 
Perhaps you could clarify what you are asking.

The formula for this solution is "Minutes: Hour(TimeDiff)*60+Minutes(TimeDiff)".
 
Or...

I = CLng( 24*60 * CDate( "your time string here" ) )

or

I = CLng( 24 * 60 * Cdate( [ your time-string field here ] ) )

(Spaces were added to protect my poor old eyes... and everyone else's)
 
Or...

I = CLng( 24*60 * CDate( "your time string here" ) )

or

I = CLng( 24 * 60 * Cdate( [ your time-string field here ] ) )

(Spaces were added to protect my poor old eyes... and everyone else's)


thanks for the help the dock man, i got it......:o
 

Users who are viewing this thread

Back
Top Bottom