Check the virtual memory settings in the OS.
The minimum pagefile should be RAM + 11MB.
Also check if you are getting blocks by running sp_who2 active. This will tell you if you are getting lots of locking contention.
If the query is regularly used, write it into a stored procedure and let the users call it.
Run DBCC Checkdb against all the databases (after hours with a scheduled job).
Also run the index wizard to evaluate where indexes might alleviate the bottlenecks.