Results 1 to 5 of 5

Thread: Time Clock help

  1. #1
    Join Date
    Jul 2009
    Posts
    16

    Unanswered: Time Clock help

    I have in my database a working time clock that tracks my employees time. My function to figure out hours and minutes works and looks like this:

    =HoursAndMinutes(Sum([Time Out]-[Time In]))
    **time out and time in are just time stamps from when they pickup equipment and then drop it off....

    what i need is to add break time in there. i have a break field as a number and have supervisors put in break time in minutes.

    what i'm trying to do is take this: =HoursAndMinutes(Sum([Time Out]-[Time In])) and subtract the break in minutes from it....

    please help.

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    Convert it all to minutes first then take the break mins off.
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Jul 2009
    Posts
    16
    can i get help with that conversion?

  4. #4
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    Just use datediff

    SQL Syntax is
    SELECT (DateDiff(n,YourStartDate,YourEndDate)) AS datDate

    Access is same except 'n' is in quotes...

    Here is a more detailed defenition of the DateDiff function...

    http://office.microsoft.com/en-us/ac...CH100728911033
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    If =HoursAndMinutes(Sum([Time Out]-[Time In])) gives you problems with the break time subtraction, you can also try creating another textbox and subtract the break time total from whatever your =HoursAndMinutes(sum(...)) field is named versus trying to do the entire calculation in one field.

    I will sometimes break the calculations up into different textbox controls and use additional textboxes to reference the total in another textbox (or in a query).
    Last edited by pkstormy; 09-28-09 at 20:34.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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