Use the standard functions in the */includes/db/*.inc files or roll your own in your module and include them in the report. If such SQLs are going to be used exclusively in the specific report only, make the wrapper function in the report itself or use it inline.
Study the existing reporting/repXXX.php files and the variable input form parameters file reporting/reports_main.php.
If you wish to have your own class of reports (Reports and Analysis Menu), then append it to the first stanza in reporting/includes/reports_classes.inc:
// Standard report classess
define('RC_CUSTOMER', 0);
define('RC_SUPPLIER', 1);
define('RC_INVENTORY', 2);
define('RC_MANUFACTURE', 3);
define('RC_DIMENSIONS', 4);
define('RC_BANKING', 5);
define('RC_GL', 6);
define('RC_PAYROLL',7); // <------ Added now