Results 1 to 5 of 5

Thread: Sum fields

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Sum fields

    hi please help.how write the query abs((attendmatch.timediff)-(employee.Workhours)and <>(employee.category='Restday') AS Diffhours

    i want to get the Diffhours result abs((attendmatch.timediff)-(employee.Workhours)) AS Diffhours ,if overtime.categoryday =restday then diffours is =timediff ,if overtime.category is not = restday then Diffhours

    this is current code:
    Code:
    SELECT DISTINCT attendmatch.employeeno, attendmatch.overtimedate, employee.Workhours, attendmatch.timediff, abs((attendmatch.timediff)-(employee.Workhours)and <>(employee.category='Restday') AS Diffhours, overtime.othours,overtime.categoryday,overtime.department
    FROM attendmatch, employee, overtime
    WHERE attendmatch.employeeno=employee.employeeno and attendmatch.employeeno=overtime.employeeno and attendmatch.overtimedate=overtime.overtimedate
    GROUP BY attendmatch.employeeno, employee.employeeno, attendmatch.overtimedate, employee.Workhours, attendmatch.timediff, overtime.othours, overtime.categoryday,
    overtime.department
    thanks for help.
    Last edited by gracehskuo; Jul 24th, 2008 at 03:50 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
  •  



Click Here to Expand Forum to Full Width