Results 1 to 3 of 3
  1. #1
    CSUjr is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    4

    Question Calculating Trip Time

    I'm relatively new to Access 2007 and need some help in calculating,
    and showing, how much time (hours:minutes) there is between a 'Start Time' & an 'End Time'.

    I have imported the fields of my Table from Excel.
    3 of these fields are;
    Start Time (h:nn:ss AM/PM)


    End Time (h:nn:ss AM/PM)
    Total Time (= End Time - Start Time)

    An example of these, in Excel, is;
    [Start Time] (Q10) 11:00:00 AM
    [End Time] (R10) 12:00:00 PM
    [Total Time] (fx =R10-Q10) 1:00 (hour)

    I have tried building a Query based on this,
    in the Table and also in a Form (based on the Table),
    but I can't seem to get either to work.

    Can someone tell me how I can make the Total Time field auto-fill,
    in hour:minute format, when the Start Time and then the End Time is entered into their fields?

    With appreciation,
    Charles

  2. #2
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    Hi,

    try the function DateDiff.
    For instance you can create the following calculated field in a query to get the amount of minutes between the 2 times:

    fldMinutes: DateDiff("n",[Start Time],[End Time])

    greetings
    NG

  3. #3
    CSUjr is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    4

    Thank You

    Thank you for your reply.

    I tried your suggestion in a few different ways without success.
    I'm really not sure what I'm doing wrong, or not doing right.

    First, I have a blank field in my Table that is labeled Trip Time.
    and again, I'm trying to have the difference between
    the Start Time & the End Time show (in hours & minutes)
    in the field that is labeled Trip Time.

    When I tried copying & pasting your suggestion;
    fldMinutes: DateDiff("n",[Start Time],[End Time])
    I got this error message;



    Then I tried variations of this, including;
    DateDiff("nn",[Start Time],[End Time])
    but still with no success.
    Can you tell me what I'm doing wrong, or not doing right?

    With appreciation,
    Charles

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

Similar Threads

  1. Calculating Max appointments
    By ET123 in forum Access
    Replies: 2
    Last Post: 07-24-2010, 07:32 AM
  2. Calculating turnaround time on workdays
    By mathonix in forum Queries
    Replies: 1
    Last Post: 04-22-2010, 05:34 PM
  3. Need help with calculating Time total
    By Monoceros in forum Reports
    Replies: 1
    Last Post: 04-20-2009, 12:44 PM
  4. Help requested for calculating age
    By techexpressinc in forum Queries
    Replies: 3
    Last Post: 01-28-2009, 11:29 AM
  5. Calculating a sum on a report
    By missourijc in forum Reports
    Replies: 0
    Last Post: 10-30-2008, 07:21 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