At 11:08 PM 7/7/2008, Bill Niehaus wrote:
I have a report based upon a table (field) that I want to show a sum
based upon a second table (rawdata).
In the past I used a variable to lookup data from the second table.
vstand2 = Stand2 in RawData WHERE trial = trial AND plotnum = plotnum
Is there a way to define a variable to do a sum on a second table, or
do I need to create a view and do a dbcalc on the view?
Bill,
You should still be able to define lookup expressions, to be calculated
on appropriate band (Detail, Break Footer, Page Footer or Report Footer).
Also, defining the vTrail and vPlotNum column values as variables, and
vSumStand2 as totals from a RawData, you may also use the following
statement on appropriate band as "Before Generate Custom EEP" in report.
Example:
-- Start
CLEAR VARIABLE iv%,vSumStand2
SET VAR vSumStand2 INTEGER = NULL
SELECT (SUM(Stand2)) INTO vSumStand2 INDIC ivSumStand2 FROM RawData +
WHERE Trail = .vTrail and PlotNum = .vPlotNum
RECALC VARIABLES
RETURN
-- End
-- Adjust the appropriate data types accordingly
vTrail and vPlotNum variables are defined as Report Expression as:
. vTrail = (Trail)
. vPlotNum = (PlotNum)
Calculated on [Detail] band.
Hope that helps!
Should you need a sample report to demonstrate the use of such feature,
let me know.
Very Best R:egards,
Razzak.
--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]
(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================