Results 1 to 7 of 7
  1. #1
    alhareri is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    6

    Subtract 8 hours of work from result hours


    I want to subtract 8 hours of work of the Result of employee work hours
    there is attachment
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The TimeWork value cannot be a string like 7:30. Needs to be decimal like 7.5.

    So either fix the HoursAndMinutes() function to return decimal or do another calculation to convert the returned string to a decimal and subtract it from 8.
    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.

  3. #3
    alhareri is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    6
    hi
    so do you have another calculation to convert my time .. please help
    because i try several thing but isn't working
    thanks

  4. #4
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528
    Try using something like
    Code:
    SELECT Tbl_TimeOutIn.SalaryNo, Tbl_EmpName.EmployeeName, Tbl_TimeOutIn.DateIn, Tbl_TimeOutIn.TimeIn, Tbl_TimeOutIn.TimeOut, Tbl_TimeOutIn.Writer, Tbl_TimeOutIn.HideTime, HoursAndMinutes([Timeout]-[Timein]) AS TimeWork, Tbl_TimeOutIn.HourTime, Tbl_TimeOutIn.TimeShift, HoursAndMinutes(1/3-([Timeout]-[Timein])) AS TimeNotWorking
    FROM Tbl_EmpName LEFT JOIN Tbl_TimeOutIn ON Tbl_EmpName.salaryNo = Tbl_TimeOutIn.SalaryNo
    WHERE (((Tbl_TimeOutIn.HideTime)=No));

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Really need decimal hours in query so values can be used in calcs, such as aggregating records. Calculate the HH:MM string in textbox on report.

    Review https://www.accessforums.net/queries...urs-47434.html
    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.

  6. #6
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528

  7. #7
    evander is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    How about subtracting 8/24 from the total hours?

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

Similar Threads

  1. Replies: 2
    Last Post: 05-10-2013, 07:10 AM
  2. Replies: 1
    Last Post: 08-21-2012, 02:48 PM
  3. Replies: 1
    Last Post: 08-08-2012, 01:42 PM
  4. Replies: 4
    Last Post: 08-06-2012, 10:25 AM
  5. Can hours be sum?
    By newtoAccess in forum Queries
    Replies: 9
    Last Post: 10-10-2011, 11:01 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