Query to summarize by work week

saseymour

New member
Local time
Yesterday, 20:20
Joined
Jun 12, 2013
Messages
8
Ok, here is my issue.

I've got three fields - date_time, # of issues, issue reasons

I want to summarize these by work week.

So,

WW....... # of issues ...............................issue reasons
1 ..........<sum of all issues for the week>..list of all reasons entered
2 ..........<sum of all issues for the week>..list of all reasons entered
3 ..........<sum of all issues for the week>..list of all reasons entered
4 ..........<sum of all issues for the week>..list of all reasons entered
5 ..........<sum of all issues for the week>..list of all reasons entered

I know how to get the WW part - I do the datepart("ww",[Date_Time] for the expression. But how to write the query to do the other 2 parts, I'm lost.

Any ideas?
 
You need to add another column

Code:
select format(date_time, "ww") as Weeknumber, sum([# of issues]), [issue reasons] from table1
group by format(date_time, "ww") , [isseu reasons]

HTH:D
 

Users who are viewing this thread

Back
Top Bottom