by MYLE
21. June 2010 21:49
I have been ask many time what the best way to store hours in a data base.
as hour is a mod 60 what I do store MINS and use the below function to convert the mins to time format so
if a job took me 1:30 I store the min value 90min then if a did and other hour store that as 60 then add the mins up 150min total pass the
total = Mintohrs(150)
total would show 02:30 HrstoMin
Function Mintohrs(Tmin)
hh = Int(Tmin / 60)
tt = hh * 60
mm = Tmin - tt
Mintohrs = DIG(hh) & ":" & DIG(mm)
End Function
hourtomin
my other Functions
03:15 = Mintohrs(90+90+15)
I use and other Function I wrote to format the Mins
c9b9ba64-9cbd-4b74-b92f-75d3c1dd04e6|1|5.0
Category: ASP, MSaccess, VB
Tags: