How to retrieve and sort info from table for a report
I'm having trouble getting my head around this problem and could use your help.
My db contains a table that tracks info for the state's youth court system (see attached). I need to be able to retrieve info from this table by category, county, race and gender so that I can answer queries such as, "how many white female teen volunteers were there in Davidson county this quarter?" i.e, how many #race# #gender# #category# were there in #county# this #quarter# of #year#?
I'm sure that this is possible, but I'm having trouble wrapping my head around how to retrieve that info. I can look at the image and quickly see that the answer is zero. There were no white female teen volunteers during the 3rd quarter of 2013 but I'm fuzzy when it comes to logic needed to retrieve that info.
I am thinking that a script is needed: something to parse each line of the database and assign quantities to variables: e.g., $numWhiteFemaleTeenVolunteersDavidson = 0, $numWhiteMaleTeenVolunteersDavidson = 12, etc. Then I'd retrieve the values of those variables to create the report we need.