Results 1 to 5 of 5
  1. #1
    DubCap01 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2014
    Location
    Dubbo, Australia
    Posts
    104

    Calculate number of minutes between Midnight + 1 minute, and a Start Time later that day

    Hi all,

    Sorry, please ignore the "+ 1 minute" in the subject title

    I need to update a table field (Table = TblNoPTV; Field = StartMins) with the number of minutes between Midnight (0:00am?) and the start time of an event. Events in this table can be stored on any day of current month, so the date should not really play a part in it.

    Example:
    Date 31-Mar-15, Event Start Time 8:29am, so updated field to reflect the value 509
    Date 24-Mar-15, Event Start Time 12:29pm, so updated field to reflect the value 749

    If I can get this working, I can help our hospital to channel their resources at peak times in different areas/zones, enhancing clinical quality and patient safety.



    Many thanks in anticipation folks!

    Pete

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,413
    try

    datepart("n",eventdate)

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,413
    sorry didn't finish the answer


    datepart("n",eventdate)+(60* datepart("h",eventdate))

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    This also works
    Code:
    Sub MinuteTest()
    
        Dim StartTime As Date
        Dim EndTime As Date
    
        StartTime = #12:00:00 AM#
        EndTime = #8:29:00 AM#
    
        MsgBox DateDiff("n", StartTime, EndTime)
    
        StartTime = #12:00:00 AM#
        EndTime = #12:29:00 PM#
    
        MsgBox DateDiff("n", StartTime, EndTime)
    
    End Sub

  5. #5
    DubCap01 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2014
    Location
    Dubbo, Australia
    Posts
    104
    Thanks all,

    Steve, used your version

    cheers
    Pete

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

Similar Threads

  1. Calculate Minutes Between Two Dates and Times
    By robrich22 in forum Programming
    Replies: 3
    Last Post: 01-31-2014, 07:56 PM
  2. Replies: 42
    Last Post: 03-01-2013, 06:58 AM
  3. Calculate start time.
    By Mantaii in forum Reports
    Replies: 5
    Last Post: 02-28-2012, 12:31 PM
  4. Replies: 1
    Last Post: 02-22-2012, 04:59 PM
  5. Replies: 11
    Last Post: 08-04-2010, 04:26 PM

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