Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2022
    Posts
    21

    Unhappy Get time elapsed and number of instances

    Hello,



    I am a little lost on this and I need some help. I created a simple access database to scan users in and out with a time stamp and some other information as seen in my attached image. I use SQL to read and write to the database, but I need a query or vba function or something to get the entire instance of a persons name, date range with elapsed time between scans, and how many times scanned START and STOPPED.

    For example, if I have something like

    3/15/2022 8:30AM John Smith
    3/15/2022 9:00AM John Smith

    I would like to get the time elapsed from the table, the number of occurrences for start and stopped, and put it in a report or a chart? I'm lost...

    Attachment 47440

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    a Date field can hold both Time and Date, there's no need for 2 fields.

    using VB, you will need to cycle thru the records 1 by 1. (make sure they are sorted correctly)
    get the start,
    next rec
    get the Finish
    calc elapsed time in minutes: DateDiff("m",vDateStart, vDateEnd)
    post result to a table.

  3. #3
    Join Date
    Mar 2022
    Posts
    21
    ranman256,

    Is it still possible to get elapsed time with two different columns with date/time? and if so how? I'm lost and it's out of my scope of practice...

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Combine your two fields into one in a query then use ranman's suggestion. With questions like this it is always best to create a small db sample with some "dummy" data to illustrate your issue as it helps to see it when providing an answer. Somebody needs to create that and you are in the best position to do it .

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    Join Date
    Mar 2022
    Posts
    21
    Thanks, working on it now!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Convert elapsed time to number format
    By ICBSprod in forum Queries
    Replies: 20
    Last Post: 12-12-2019, 10:08 AM
  2. Replies: 2
    Last Post: 10-12-2016, 05:48 PM
  3. Elapsed time
    By albzn in forum Access
    Replies: 6
    Last Post: 11-14-2015, 06:09 PM
  4. Counting number of instances by time of day
    By Abarency in forum Queries
    Replies: 1
    Last Post: 11-11-2012, 04:53 PM
  5. HELP With Elapsed Time in Form
    By accessineedhelp in forum Forms
    Replies: 6
    Last Post: 09-01-2011, 10:30 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums