Initial RDL build - query refined and turned into stored proc