General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL cursor question
I have a rpt13.prg which creates a cursor from an SQL statment and then REPORT FORM rpt013a.frx. The result set of the SQL statement returns duplicate customer records because cust_num is not unique in the sales table. But the report has no Detail Section, just a Group Footer section that resets on Customer Number and sums the sales.sal_amt field.
SELECT sales.sal_amt, customer.cust_num, customer.cust_name ;
FROM sales, customer ;
INTO CURSOR rpt013a ;
WHERE customer.cust_num = sales.cust_num
The client now wants a new column on the report, the sum of customer refund amount - refund.ref_amt - for each customer. Customer number is not unique in the refund table.
I am at a lost on how to get the customer refund amount on the report. Any help or ideas would be appreciated.
The above example is greatly simplified, but does explain the basic idea of my need.
Thanks
Brenda
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only