|
-
Feb 23rd, 2000, 05:07 AM
#1
Thread Starter
Junior Member
Hey People, I am trying to write this VBA script in Access, perferable in a table if possible otherwise a form. I want to keep track of people who log onto a system by DateIn, TimeIN, DateOut, TimeOut. Then I will have a Total that will accumulate the the total number of hours logged onto the system. I am running into problems when someone logs on like this 2/15/00 1:00AM - 2/17/00 3:00AM. Instead of getting 50 hrs I get two hrs in the total Hours. I would appreciate any help, thanx in advance
-
Feb 23rd, 2000, 05:15 AM
#2
Lively Member
If you store the Date and Time in the same field you can then take the DateDiff function to calculate the difference between your two dates in hours.
-
Feb 23rd, 2000, 06:30 AM
#3
Frenzied Member
Add dayhrs to whatever you're using to calculate the total hours now:
dayhrs= 24 * (cint(startdate) - cint(stopdate))
date fields are floats, the integer portion represents dates, the decimal portion time. By converting to integer, you're discarding the time portion.
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
|