Results 1 to 11 of 11
  1. #1
    Alphix is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    61

    Calculated Controls (Need to calculate time difference and total times elapsed)

    Field 1A = 1:00:00 pm
    Field 2A = 1:15:00 pm

    (Need total time elapsed in Field 3A)

    Field 1B = 2:00:00 pm
    Field 2B = 2:15:00 pm

    (Need total time elapsed in Field 3B)

    Field 4C = Total of field 3A + 3B

    (01) I do not know what formula to type in field 3A and 3B to calculate in decimals
    (02) I do not know what formula to type in field 4C to add 3A and 3B to get the Total results.

    Please help

    Thank you in advance.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Do you want the results as decimal hours (3A = 0.25 hrs) or minutes (3A = 15.0 minutes)??
    Use the DateDiff() function.

    Just add 3A and 3B together as you demonstrated.

  3. #3
    Alphix is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    61
    I would like to have it in decimal hours.
    Can this be done? if so how can I write this out?

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Can this be done? if so how can I write this out?
    Look in Help for the DateDiff() syntax.

  5. #5
    Alphix is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    61
    I tried the below formula.

    =DateDiff("n",[Time1Start],[Time1Stop])\60 & "." & Format(DateDiff("n",[Time1Start],[Time1Stop]) Mod 60,"00")

    The result is not a true decimal number because of the input of "." and "00"

    I am confused on how to make this a true decimal number.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Cut off the "." and the following expression.

    Dividing by 60 will return decimal hours. Don't worry about displaying decimal placeholders in query. Format textbox on report.

    However, can set the Format property for each field in query - I have never bothered with this.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Alphix is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    61

    I need help with my formula for calculating total time

    time calculator.zip



    I have hit the wall in trying to figure out how to make my field box add up the total times.
    Also the results in A & B are not real numbers. How do I make these boxes have real numbers?

    Can someone help me fix???

    Please see attachment.

    Thank you in advance.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    The answer was provided in your other thread. Same topic so I combined them. See post 6.

    However, expressions in textboxes are not properly calculating because you have the wrong symbol for division operator. Should be / not \.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    Alphix is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    61

    Not able to calculate the totals of the 2 fields???

    Thanks for the previous help. Yes your answer did work for the 2 top fields.

    Now I am having trouble calculating the totals in the Total field box.

    The box seems to keep recognizing both top field results as text and just treat it

    as an addendum instead of adding the numbers together.

    Please help.

    time calculatorREV2.zip

    Thanks in advance.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You still haven't done what I suggested.

    Result_A: =DateDiff("n",[Time1A],[Time2A])/60

    Result_B: =DateDiff("n",[Time1B],[Time2B])/60

    Now set the Format and DecimalPlaces properties of the textboxes.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    Alphix is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    61
    Thanks...Yes that did the trick.

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

Similar Threads

  1. Replies: 4
    Last Post: 10-10-2014, 02:39 PM
  2. Replies: 5
    Last Post: 09-11-2013, 03:42 PM
  3. calculate time elapsed
    By chavez_sea in forum Access
    Replies: 3
    Last Post: 07-29-2013, 09:21 PM
  4. Total elapsed time
    By Craigind in forum Access
    Replies: 1
    Last Post: 05-14-2012, 03:54 AM
  5. HELP! Elapsed Time Difference
    By accessineedhelp in forum Access
    Replies: 5
    Last Post: 08-31-2011, 06:00 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