- Mar 13, 2007
 
- 1,100
 
- 0
 
- 76
 
First I have to complain at my boss for being so freaking picky about how all this stupid stuff looks. 
Well this is for a report, I work for a drug clinic and we have everyone do a report when the come in and with the leave. The report asks in the last 30 days, how many days did you do x?
All the data gets grouped together into a report so we can see out totals of how many people did drugs how many days when the cam in and when they left. First the I have a querey that dose a group by the number of days, then a second column that dose a count of each day, ends up looking like this.
Number of Days, Number of people
0 ---------------------- 12
3 ---------------------- 22
4 --------------------- 7
13 --------------------- 25
30 --------------------- 65
Anywyays the report is usually pretty big looking cause if we had 1 person do drugs 15 times a month, and 1 person do them 25 its keeps adding lines. So anyways I need to group them into sections of 0, 1-10, 11-20 21-29 and 30, in some reasonable way. Right now im trying to replace one of the previous guys databases who had upwards of 300 queries and reports to do, well even less then this. So the simply I can make this the better.
edit* Maybe I can use an if statement or something before I do a count, that says if its between 1-10 set it = 10 or something? not sure if thats possible.
			
			Well this is for a report, I work for a drug clinic and we have everyone do a report when the come in and with the leave. The report asks in the last 30 days, how many days did you do x?
All the data gets grouped together into a report so we can see out totals of how many people did drugs how many days when the cam in and when they left. First the I have a querey that dose a group by the number of days, then a second column that dose a count of each day, ends up looking like this.
Number of Days, Number of people
0 ---------------------- 12
3 ---------------------- 22
4 --------------------- 7
13 --------------------- 25
30 --------------------- 65
Anywyays the report is usually pretty big looking cause if we had 1 person do drugs 15 times a month, and 1 person do them 25 its keeps adding lines. So anyways I need to group them into sections of 0, 1-10, 11-20 21-29 and 30, in some reasonable way. Right now im trying to replace one of the previous guys databases who had upwards of 300 queries and reports to do, well even less then this. So the simply I can make this the better.
edit* Maybe I can use an if statement or something before I do a count, that says if its between 1-10 set it = 10 or something? not sure if thats possible.
				
		
			