Primer
The first concept to understand about a Report is that every report is built on top of a SQL query. If you are building a report from the ground up, you will have to write a new sql query or adapt an existing one to your needs.
Before we get into running and building a report, we will take a look at a query. For this tutorial, we will take apart a fairly complex query that uses some dynamic SQL to do some neat stuff. Lets get started.