Use the following generic SQL query function for generating reports.
sqlQuery( )Report data structures