Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Time to a number

Status
Not open for further replies.

darinmc

Technical User
Feb 27, 2005
171
GB
Hi
I have the simple code below to calculate the time difference.
How would I change or format the final result

1:30 TO a number 1.50

Code:
Private Sub cmdTdif_Click()
Me.Tdif = HoursAndMinutes(Me.Tout - Me.Tin)
End Sub

Thx
Darin
 
Why not use DateDiff:

Diff_Minutes=DateDiff(Me.Tin,Me.Tout)
 
I'm getting:
DateDiff - Agument not optional

Darin
 
Oops.


Diff_Minutes=DateDiff("n", Me.Tin,Me.Tout)
 
Thats great, now how would I convert 90 to 1.5?

Before I was getting 1:30
But i need it to read 1.5

Thx
Darin
 
Thx, Didn't think it would be that easy as I thought the 90 was still in a different format...

Thx
Darin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top