Results 1 to 8 of 8
  1. #1
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155

    Adding Time


    Hey, I've been stuck on this for days!


    I have a formula set up in text boxes:

    =Format([w_start]-1-[w_end],"Short Time")

    To determine total time worked.

    I need those to be able to add or subtract those text boxes from each other. I would like to have a query that will just calculates the total paid time.

    Work Time (above equation) - Lunch - Break 1 - Break 2

    Is this possible?

    Please note that when I use the equation, the format is 00:00 which is where I am running into a issue...

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Access stores dates/times as a number with the integer portion representing the number of days since 12/31/1899 and the decimal portion representing the fraction of a day. Basically you have to do all of the calculations before formatting. But looking at your previous post that included an attached database, you have a normalization issue that needs to be corrected first. Since a worker can have many start and end date/times event (whether it is for starting work, taking a break, taking a lunch etc.) that describes a one-to-many relationship. It would be best to handle each time transaction as a record in a related table


    tblEmployee
    -pkEmpID primary key autonumber
    -txtFName
    -txtLName


    tblEmployeeTimeTransactions
    -pkTransID primary key, autonumber
    -fkEmpID foreign key to tblEmployee
    -dteTrans (date/time of transaction)
    -fkTransEventID a field to indicate what the transaction is for such as clocking in for the work day, clocking out for lunch etc.; foreign key to tblTransEvents


    tblTransEvents
    -pkTransEventID primary key, autonumber
    -txtTransEvent

  3. #3
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I'm not sure I understand completely?

    Can you provide me with an example?

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I've attached a sample database that illustrates the structure I proposed. I did add 1 additional field to the events type table that distinguishes a clock IN event from a clock OUT event. I included a base form/subform for data entry as well as a series of queries that shows how to bring the start and stop times together. qryStartTimes shows all of the applicable start times while qryEndTimes show all of the applicable end times. I then bring those queries together in qryHoursWorkedDetail to show how the time worked for each interval is calculated. I also show the time worked in the 00:00 format. I then provided a summary of time worked for each employee for each day (qrySumOfHoursWorkedByDayForEachEmployee) and another summary query showing the 00:00 format.

  5. #5
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Thanks for the sample. I am more over a visual person. Do you know how to take the scroll function off the mouse in the databases? I want to incorperate a search function by Employee ID but I do not want people to be able to scroll into other records even if I remove the naviagation bar...

  6. #6
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    One easy way is to use an unbound form where you input the employeeID and then open the form I provided early to that specific record. I've modified the early database with this new form & attached it. I put 1 textbox control (for the ID) and then used the command button wizard to open the frmEmployee to the specific record that had the same ID. With this approach, the user will only see the record for the particular employeeID that they entered into the textbox.

    As to stopping the scrolling with the mouse. That is not something with which I am familiar, sorry.

  7. #7
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    This sample works for this project. But I will continue to research the scrolling function for other projects I have. The only tips/hints ive gotten deals with computer settings which I do not want to mess with. If I figure it out, I'll create a new post and post the solution!

    Thanks for the help.

  8. #8
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Sounds like a good plan and thank you!

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

Similar Threads

  1. Replies: 12
    Last Post: 02-22-2011, 03:39 PM
  2. Replies: 6
    Last Post: 01-04-2011, 05:43 PM
  3. Replies: 2
    Last Post: 12-23-2010, 09:11 AM
  4. Adding the Date & Time record added
    By jo15765 in forum Access
    Replies: 2
    Last Post: 11-26-2010, 11:31 PM
  5. Help with Adding Time Stamp to Contact
    By shanethomp in forum Access
    Replies: 1
    Last Post: 11-09-2010, 09:43 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