Results 1 to 3 of 3

Thread: Date/Calculation

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    USA
    Posts
    27

    Post

    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

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Springfield, IL
    Posts
    124

    Post

    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.


  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    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
  •  



Click Here to Expand Forum to Full Width