It would have been more useful for understanding purposes
if you posted some sample data along with table structure
as fields to us make no sense as just by looking at them.
My guess is you are looking for cross tab, pivoted table
queries. Please refer to following articles:
You could also use these tools: