Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    156

    Unanswered: Sums in Query

    I have a query running on a table that has the date, the employee and how many hours they've worked. What I need to do is sum the hours up by week so that I can multiply regular hours by their regular rate and their overtime hours by their OT rate.

    I know I need to group by dates by week with a DatePart function or something similar and then Sum on the hours worked. Is it possible to group an employee's hours together only by week? And then have it group the next week's hours together, etc. etc. for each employee?

    Big thanks in advance!
    Last edited by DocX; 10-12-04 at 14:34.
    DocX

    The teachings of God's Begotten: 2 John 1:9

  2. #2
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    421
    Use: Format([DateField],"WW",2,2)

    the 2,2 part means that your in Europe, Week starts on Monday and week 1 is the first week with 4 days in the new year. Check the help on the format function.

    Then simply group by and sum ...

    Greetz

Posting Permissions

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