What are the "#testTable tt" and "tt." references in that query? I'm not sure what to do with those.
(Sorry. I'm still new to SQL code. Until this current assignment, all the reports I've had to write could be done with the visual designer with maybe a few manual modifications to a Where clause.)