I apologize if I'm misinterpreting the situation (I am probably oversimplifying), but I think there is better way to deal with this situation...
You could add an identity key to the history table. It would be easy to derive the sequence of events when querying this table- just sort by the...
I think I understand what you're saying-
I determine what day of the week (Monday, Tuesday, etc.) a given date is, from there I can figure out the date for the Sunday of that week as my WeekStarting date by simply subtracting from the current date. Then I just use group by on the weekstarting...
I am summing timeclock hours by week with columns breaking down the daily amounts...
For example:
Name WeekStarting Monday Tuesday WeekTotal
Joe Schmoe 1/1/01 8 9 48
Joe Schmoe 1/8/01 4 10 38
Bob Schmoe 1/1/01...
Hi all,
I have a query that loops through weeks in order to sum up hours worked by employees. Everything works fine, except I get multiple result sets if I do this query without using a temp table. I figure there must be some way to work the UNION operator in at the beginning of the loop so...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.