+ Reply to Thread
Results 1 to 13 of 13

Calculating Time Differences in Access

  1. #1
    Registered User
    Join Date
    09-21-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Calculating Time Differences in Access

    I have a table in MSAccess 2010 with the below Fields.

    tblTatMonitoringSheet

    StartDate
    StartTime
    EndDate
    EndTime
    TurnaroundTime
    WithinTat?

    I want to display difference btwn start dt, start tm and end dt and end tm in TurnaroundTime field in hh:mm format. However, it shud only count time from 0630 to 2200 hrs on weekdays and 1000 to 1330 hrs on a saturday.

    Eg. 24-09-2013 21:58 to 25-09-2013 06:35 the result shud be 00:07.

    The WithinTat field shud check if value in TurnaroundTime is less than 180 minutes. Yes for true and No for false.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,716

    Re: Calculating Time Differences in Access

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (Since you are new to the forum, I have changed the title for you. Please adhere to our rules in the future. If the title I have chosen is not satisfactory to you, then please change it once more as described above.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,716

    Re: Calculating Time Differences in Access

    Please post a sample data base with some sample data in your table for analysis and test purposes. Also, what is the logic if the Start Time is on Friday and the end Time is on the following Monday. Is it possible a start time or end time will occur on a weekend? If yes, how is this to be handled?

  4. #4
    Registered User
    Join Date
    09-21-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Calculating Time Differences in Access

    Hi Alan,

    Plsfind attached sample in excel and advise how to handle in access

    I want to display difference btwn start dt, start tm and end dt and end tm in TurnaroundTime field in hh:mm format. However, it shud only count time from 0630 to 2200 hrs on weekdays and 1000 to 1330 hrs on a saturday.*

    Eg. 24-09-2013 21:58 to 25-09-2013 06:35 the result shud be 00:07.
    Attached Files Attached Files

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,716

    Re: Calculating Time Differences in Access

    Eg. 24-09-2013 21:58 to 25-09-2013 06:35 the result shud be 00:07.
    I don't understand this. The format you are showing appears to be 7 minutes. I will review the database tomorrow as I have time.
    Last edited by alansidman; 09-24-2013 at 10:50 PM.

  6. #6
    Registered User
    Join Date
    09-21-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Calculating Time Differences in Access

    Dear Alan,

    We have people working between 6:30 am to 10 pm from Monday to Friday.
    On Saturday we work 10 am to 3:30 pm.
    If someone starts a job and ends a job, the time when people are not in office shud not be included in the turntime.

    Thus 2 minutes from the started date and 5 minutes from the ended date = 7 minutes

  7. #7
    Registered User
    Join Date
    09-21-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    10

    How to Calculate Time Differences in Access

    I have changed the title for the problem. Please be kind to provide the solution

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,716

    Re: Calculating Time Differences in Access

    I have limited time available to work on this as I have other pressing issues. The problem is more complex than I originally anticipated. I will continue to explore solutions, but be aware that it may take awhile. If you find another solution in the meantime, please advise and post same to this site.

    Good luck--Alan

  9. #9
    Registered User
    Join Date
    09-21-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Calculating Time Differences in Access

    Hi Alan,

    I finally got the Function to make it work. However, I am unable to Make it work for Saturday.
    Please restructure the following so that it also counts the time between Saturday 10:00 and 13:30 instead of ignoring it as a holiday:

    Please Login or Register  to view this content.
    Last edited by alansidman; 10-04-2013 at 05:04 AM.

  10. #10
    Registered User
    Join Date
    09-21-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Calculating Time Differences in Access

    Dear Alan,

    Awaiting your response on amending the above function.

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,716

    Re: Calculating Time Differences in Access

    Please Login or Register  to view this content.
    I made some changes. They are my best guess and untested. I would urge you to go back to whomever designed the code if my changes are not effective and ask for assistance.

    I added Code tags in your earlier post. Pleas use them in the future. Read the rules on code tags.

  12. #12
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,716

    Re: Calculating Time Differences in Access

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).


    Cross Posted: http://www.accessforums.net/access/c...tes-38380.html

  13. #13
    Registered User
    Join Date
    09-21-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Calculating Time Differences in Access

    Dear Alan,

    I have only followed your instructions and not cross posted.

    Quote:
    I made some changes. They are my best guess and untested. I would urge you to go back to whomever designed the code if my changes are not effective and ask for assistance.
    Unquote.

    The changes suggested by you were not effective and hence I seeked help from the access forum from where I got the original code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calculating time differences
    By cjccpa in forum Excel General
    Replies: 5
    Last Post: 04-01-2008, 09:02 AM
  2. Calculating time differences
    By WaySlowWhitey in forum Excel General
    Replies: 3
    Last Post: 10-22-2007, 10:26 AM
  3. Calculating Date AND Time Differences
    By Lea777 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-29-2006, 12:25 PM
  4. Replies: 1
    Last Post: 05-11-2006, 05:22 AM
  5. calculating time/dates differences
    By fvglassman in forum Excel General
    Replies: 3
    Last Post: 06-22-2005, 07:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1