Hi Laura
#DEBAGE is indeed a temporary table. The reason I use a Stored Procedure with a temporary table is that the query is quite complex and execution happens faster on the server. You can use Stored procedures in Crystal Reports with parameters. I haven't done one in a while, but to use in Crystal, copy the EXEC .... statement.
Let me know if you get stuck and I will try and find some time to scratch through old customer Crystal Reports for the details of what I did. Alternatively, try adding the SP script as a view in SQL and then use the view as a table query in Crystal.
Kind regards
Peter Juby