Question

CrystalReports problem - How to use the sum() function with more than one column?

Rating9.0Excellent

I am a newbie on CR XI and have a report running that has a subreport which its only task is to return a SUM of one column of a table:
SELECT SUM(CO.QUANTITY) as TOTALOPTIONPRICE  ....

Now the requirements changed  and it needs to do something like this:
SELECT SUM( ((CO.QUANTITY - CO.STANDARDQUANTITY) * CO.CURRENTUNITPRICE) ) as TOTALOPTIONPRICE  ....
If I run the query directly on SQLServer runs fine but after I made the change in CR, the formula editor says that "a field is required", and checking the documentation I just realized the CR sum() just accepts one field or an array of fields.  I am also aware of the syntax difference in CR with the {} for the fields.

What is the best solution to fix this?, is there any specific syntax that will allow me to run it with  the CR sum() function or do I have to change the report to create a command that executes the sum() from SQLServer.

See More

Solution

Access this solution immediately by signing up as a member of CrystalReportsExperts.com--it’s quick, easy, and secure. We will return you to this solution, unlocked, when you’re done.

About this Solution

Sign up Now to View This Solution
Zone
general
Tags
sum function reports use how
Participating Experts
2
Solution Grade
B

Replies

 
by:

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: CRXIuser2005

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: mlmcc

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Log In

Forgot your password?Sign up

Stay Connected

Top Experts

  1. mlmcc

    352,274

    Wizard

    0 points yesterday

    Profile
  2. James0628

    76,896

    Master

    0 points yesterday

    Profile
  3. LinInDenver

    4,800

    0 points yesterday

    Profile
  4. peter57r

    4,000

    0 points yesterday

    Profile
  5. 13598

    3,520

    0 points yesterday

    Profile
  6. PCIIain

    1,700

    0 points yesterday

    Profile
  7. RickIsWright

    400

    0 points yesterday

    Profile
  8. Dan3D

    300

    0 points yesterday

    Profile

BrowseAre you an Expert?