Morning,I'm having a time trying to get this to sum up. I have a cost and a week. I want it to look at the data for each week, and take the cost of just that week. Unfortunately the only way to get weekly data is join the job table to the time table. Like so:SELECT DATEPART(wk,t.Work_Date) AS 'Week #', (J.Act_Labor+J.Act_Labor_Burden+J.Act_Material)CostFROM Time t INNER JOIN Operation o ON t.Job_Operation = o.Job_Operation INNER JOIN Job j ON o.Job = j.JobWHERE J.Type <> 'blanket'and J.Customer_PO = '2345689'and DATEPART(wk,t.Work_Date)= 2order by t.Work_Date desc
This is what I get for data:2 450.68582 19552.422 223583.952 223583.952 223583.952 223583.952 223583.952 223583.952 16626.002 16626.002 390.78572 538.81332 15081.152 15081.152 223583.952 223583.952 223583.952 223583.952 1178.66112 1178.66112 223583.952 223583.952 223583.952 223583.952 223583.952 223583.952 223583.952 223583.952 538.81332 16626.002 19552.422 390.78572 691.112 1115.222 15081.152 0.002 223583.952 5815.772 223583.952 223583.952 223583.95
So what I would like to see is this:2 02 390.78572 450.68582 538.81332 691.112 1115.222 1178.66112 5815.772 15081.152 166262 19552.422 223583.95
I've tried grouping, rollup, distinct and group by with no success. Eventually I need it to take the last set of data and sum it by week. Any ideas would be appreciated.ThanksLaura