• As a follow up to my other post, I do agree with GSquared that this stuff is usually easier to do in the application/report. For example SSRS (SQL Reporting Services) would deal with this very easily.