PDA

Click to See Complete Forum and Search --> : How Do I add Time?


rayed78
Aug 2nd, 2000, 01:48 PM
In a Table I have a two time fields one time_in the other Time_out How do I add both and que the result in Hours and minutes, instead of decimal numbers.

JHausmann
Aug 2nd, 2000, 03:06 PM
Sounds like you might want to look at DateAdd and DateDiff.

rayed78
Aug 7th, 2000, 12:02 PM
Thanks for all the help. dateDiff and dateAdd did not help me in the problem but I sure learned alot from those two commands. the way I did it was a long way. Break the time the hours in minutes and then ad it to the minutes of the hours an then put it back in hours and minutes format.

for instance:
Tminutes_in = (Hours_in * 60)+minutes_in
Tminutes_out =(hours_out *60)+minutes_out

Totalminutes= Tminutes_out - Tminutes_in
total_hours = Totalminutes/60
Total_minutes= totalminutes mod 60
txtDisplayTime.text = total_hours & ":" & total_minutes

I hope it helps some one out there :)