Results 1 to 2 of 2
  1. #1
    cap.zadi is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481

    TimeDiff calculations inside Query.

    Hey there,

    I am looking to find out the right way to calculate the timediff among two fields in a query.

    Machines TimeStop TimeRestart

    This is the formula which i applied

    DownTime: Round(([RestartTime]-[StopTime])*24,2)

    It works fine but the problem is it took the calculation of minutes upto 99 and then convert to 1Hour.

    so please advise how to do this?



    thanks

    zee

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if you want it to be displayed as 90 (minutes) use

    datediff("n", StopTime, RestartTime)

    If you want it to be displayed as 1.5 (hours) use

    datediff("n", StopTime, RestartTime)/60

    assuming of course your stop time and restart time are both stored as date/time fields.

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

Similar Threads

  1. Time Diff Calculations inside Query.
    By cap.zadi in forum Queries
    Replies: 2
    Last Post: 09-12-2011, 10:04 AM
  2. Replies: 7
    Last Post: 06-29-2011, 08:07 PM
  3. Filtering and using First() inside a query
    By Gilligan in forum Queries
    Replies: 17
    Last Post: 03-10-2011, 05:52 PM
  4. Replies: 3
    Last Post: 12-20-2010, 09:22 AM
  5. Calculations in Query
    By jdhaldane in forum Queries
    Replies: 5
    Last Post: 12-10-2010, 05:57 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