I have an attendance table in SQL Server 2012 named tblOrgHours. (attached) This is where I log all my attendance for different agencies in tracking how many hours each activity has been performed each day by different kids. The ActivityID in this table is relational with tblOrgActivity. (attached) The RegID in that same table is relational with the student information found in table tblOrgRegistrations. (attached) I need to create an sql query that will output all the activity that has happened in a month. So,for example, I need the output for January to show all the unique activities that have occurred each day, line by line, for a given agency. Each line would represent an activity that has taken place for a given date in that month and the number of kids for that particular activity, along with specified age ranges and gender. To illustrate this is an example below of what the output headings would need to look like. I also attached a non accurate sample Output of what I am trying to achieve.
Agency, ActivityName, ActivityDate, # of individuals that had > 0 hours that day, # of youth ages 11-13, #of youth ages 14-18, # of females, # of males
I'm hoping this will also help me utilize JOIN statements better as I am very novice to SQL. Please ask me any follow up questions and I will try my best to answer. I would have pasted some of these tables here in this question, but I'm not sure how to do it so it looks clean.