|
-
October 28th, 1999, 09:11 AM
#1
help!
Dear all,
Many thanks for the recent posts on calculating time differences, but im still having problems with this.
I have two fields inside a recordset which are type text, they have captured the time using the 'time' function. The field therefore looks something like this 3:09:31 PM.
The fields are used for capturing login and logout times.
First field 3:09:31 PM
Second 3:15:16 PM
Now i don't need to work out date differences, only times. But i obviously want to return something like 6 mins so many seconds, instead of xxxx seconds. Can someone pls point me in the right direction.
Many thanks for all your help.
-
October 28th, 1999, 01:58 PM
#2
Re: help!
You coudl use the CDate Function to convert the Strings to Date/Time Variables, then Subtract One from the Other, eg.
private Sub Command1_Click()
Dim sTimeDiff as string
sTimeDiff = Format(CDate("3:15:16 PM") - CDate("3:09:31 PM"), "NN:SS")
End Sub
In this case sTimeDiff Would Contain "05:45", (5 Mins, 45 Secs).
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|