Luis Cazares (2/6/2014)
There's a simple reason of why would I do this on the front end. Formatting totals and subtotals is a lot simpler that way.
If the front-end code has capabilities similar to the Matrix capabilites of SSRS, I'd agree. But even then, it's good to know how to do these types of things in T-SQL because a front end doesn't always have the capability to do it easily and, sometimes, there is no front end to be had.
It's also a heck of a lot easier to deploy and maintain than managed code.
--Jeff Moden
Change is inevitable... Change for the better is not.