Results 1 to 2 of 2
  1. #1
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,103

    Calculate days, hours, minutes between two dates/time -- then sum up total net delta

    Experts:



    I need some assistance with designing a query which will calculate "total DB usage time" for each logged user.

    Background:
    - I just implemented a process where any user logins/logouts are appended to a table.
    - Ultimately, I'd like to determine how much "total time" a user ([OSUserName]) has spent in the database.

    Table Info:
    - For simplification purposes, the attached sample table "T902_Admin_SystemUserTracking" includes eleven (11) records.
    - Out of these 11 records, there are only 3 distinct users (clint.eastwood; jane.fonda; doris.day).

    Envisioned Process:
    - That is, for each user record, I want to perform basic arithmetic by subtracting the "Entry" date time stamp (DST) from the "Exit" date time stamp (DST). This should give me the net value of how many days, hours, & minutes a user's login instance lasted.
    - Then, for each user (grouped), I want to sum up the total time of the net/delta value.
    - Ideally, I'd like to have this accomplish in a single query.
    - Output should be something like:

    clint.eastwood: 1 day(s), 7 hour(s), 3 minute(s) ... or something like this
    doris.day 0 day(s), 0 hour(s), 2 minute(s) ... or something like this
    ... I don't think I need to include seconds in the output.

    Note:
    - Please note that some DbExit times contain a null value. This indicates the user is currently in the database, so any null values in [DbExit] should probably be filtered out.
    My question: What would this query look like?

    Thank you,
    EEH
    Attached Files Attached Files

  2. #2
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,103
    Never mind... I found a solution (i.e., Allen Browne's posting... found via Google).

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

Similar Threads

  1. Replies: 13
    Last Post: 02-12-2020, 04:13 PM
  2. Replies: 11
    Last Post: 12-12-2016, 12:00 PM
  3. Calculate Minutes Between Two Dates and Times
    By robrich22 in forum Programming
    Replies: 3
    Last Post: 01-31-2014, 07:56 PM
  4. Overall Total of Hours & Minutes in Report
    By StevenCV in forum Reports
    Replies: 1
    Last Post: 02-27-2012, 10:48 AM
  5. How to calculate duration in hours & minutes
    By joypanattil in forum Access
    Replies: 0
    Last Post: 11-25-2009, 04:49 AM

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