|
-
Jan 2nd, 2007, 05:18 PM
#1
Thread Starter
PowerPoster
[RESOLVED] Adding time values???
I have a database field that is defined as a "text" field but is stored as a time field "00:00:29", etc.
What I need to do is be able to accumulate this field value and I'm not sure what functions I need to use to do that.
For ex:
00:00:49
00:12:33
00:04:19
01:02:29
I need to be able to accumulate these values and give me the total time.
Thanks,
-
Jan 2nd, 2007, 05:47 PM
#2
Hyperactive Member
Re: Adding time values???
VB Code:
Dim sumTime as Single
Dim endTime As Date
Do Until rs.EOF
sumTime = sumTime + CDate(rs!timeField)
rs.moveNext
' sumTime is like 0.42345 format keep that without converting back to ##:##:## format
' OPS! Problem if sumTime > 24 hours! and converted back above format
Loop
endTime = CDate(sumTime)
Strange, but it works!
Last edited by Ember; Jan 2nd, 2007 at 05:55 PM.
-
Jan 2nd, 2007, 06:55 PM
#3
Thread Starter
PowerPoster
Re: Adding time values???
Thanks Ember, but I figured it out!
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
|