Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to add summaries from 2 different tables 1

Status
Not open for further replies.

andie18

MIS
Aug 14, 2001
198
US
Hello,

I've been asked to create a report that counts forecasted sales within a date range. My only challenge with that is I will need to pull data from 2 different database tables to get my answer.

that first table is conthist (yes, it's goldmine) and my second table is cal

right now that report counts these sales seperately with a simple formula

if ({conthist.rectype},1)="s" and {conthist.ref} startswith "Static Guarding" then 1 else 0

The cal formula is in a subreport and is the same with the exception that conthist is replaced with cal. The current report runs very well. I need at add another column showing a total of these 2 formulas.

What would be the best way to add these things together? I created subreports because they are pulling different date ranges. The cal one that I mentioned is for a 90 day date range and the parent form is for the past 7 days. This add-on needs to be on the 90 day subreport. Also, the parent form has conthist as the database and the subreport is cal. I know that I'll need to add conthist to the subreport.

thank you for any help
 
You can capture the sum from the subreport as a shared variable and then create a formula in the main report which adds the main report summary and the variable together.

eg in subreport create formula

whileprintingrecords;

shared numbervar conhist:= sum(whatever);

Then in main report, create another formula

whileprintingrecords;

shared numbervar conhist+ Sum(main report field);

You will not be able to sum thios formula, so if you need to show an overall formula, you will need to capture each result with a global variable.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top