If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to convert hours into minutes
How would I convert total hours into minutes?
For exampl: 2:10 into 130 minutes |
#2
|
|||
|
|||
How to convert hours into minutes
=?Utf-8?B?Q01USA==?= wrote in
: How would I convert total hours into minutes? For exampl: 2:10 into 130 minutes Public Function ShortTimeToMinutes(timeString As String) As Integer Dim v As Variant v = Split(timeString, ":") If UBound(v, 1) 1 Then Err.Raise 5, , "Bad short time format" ElseIf Not IsNumeric(v(0)) Or Not IsNumeric(v(1)) Then Err.Raise 5, , "Bad short time format" Else ShortTimeToMinutes = CInt(v(0)) * 60 + v(1) End If End Function Hope that helps Tim F |
#3
|
|||
|
|||
How to convert hours into minutes
Where? In a query?
Hours * 60 = minutes. Regards Jeff Boyce Microsoft Office/Access MVP "CMTH" wrote in message ... How would I convert total hours into minutes? For exampl: 2:10 into 130 minutes |
#4
|
|||
|
|||
How to convert hours into minutes
On Wed, 7 Feb 2007 09:42:01 -0800, CMTH
wrote: How would I convert total hours into minutes? For exampl: 2:10 into 130 minutes How are you getting the 2:10? Note that Access Date/Time values are NOT appropriate for storing durations; a Date/Time value is actually stored as a Double Float count of days and fractions of a day since midnight, December 30, 1899. As such, a duration over 24 hours will NOT show as (e.g.) 28:15, but as #31-Dec-1899 04:15:00#. If you're storing durations at one-minute granularity, it's usually best to store them in a Long Integer number field, and use an expression like [Duration] \ 60 & Format([Duration] MOD 60, ":00") to display hours and minutes. John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|