Link to home
Start Free TrialLog in
Avatar of garyjgs
garyjgsFlag for United States of America

asked on

Grouping ranges in SQL for Crystal Reports

I am creating a Crystal Report using SQL.  The Crystal Report has to display various ranges (or Groups) that are not contigous.  For example, this is a comparison report which displays FTE data at the top of the page. Then there is Revenue data which is then displayed.  Expenses is the third grouping.  Last group in the report is more statistical data.

"Account Nr."       "FTEs Count"   "Actuals"  "Flex Budget"   "Static Budget"

"Account Nr."        "Revenue"      "Actuals"  "Flex Budget"  "Static Budget"


"Account Nr."        "Expenses"      "Actuals" "Flex Budget"    "Static Budget"

I was trying to avoid using Groups in Crystal Reports.  Is there a way to group this in a SQL statement?
Avatar of Mike McCracken
Mike McCracken

There probably is.

Can you build it in the database?

With SQL you can add a GROUP BY clause and list the fields to group by in the appropriate order.

Or you could just sort based on those fields.

How are you handling the summary data in Crystal?

Avatar of garyjgs


I haven't addressed that yet.  I am still in the design phase.
That is when you need to address it.

Assuming a record only goes in one group, the easiest way to do this is to create the groups in the report and let the report do the work of grouping.

Avatar of James0628

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial