Post the query, so we can have a look at it.
When you perform grouping on the server there might be a problem with temp-space, which is crashing the query?
Does the query run with a simpeler select statement? That is, no group-by's, calculated fields, sums, counts etc.