|
Neither single query technique I've seen gives the right answer. Take
the follwing simple example:
Master Detail1 Detail(again)
Cust 100 Cust 100, 10.00CR Cust 100, 10.00CR
Cust 100, 10.00DB Cust 100, 10.00DB
Cust 100, 15.00CR Cust 100, 15.00CR
Correct answer would be Cust 100 25.00CR 10.00DB
Rick's query results in the following
Cust 100 10.00CR 10.00CR
Cust 100 10.00CR 10.00DB
Cust 100 10.00CR 15.00CR
Cust 100 10.00DB 10.00CR
Cust 100 10.00DB 10.00DB
Cust 100 10.00DB 15.00CR
Cust 100 15.00CR 10.00CR
Cust 100 15.00CR 10.00DB
Cust 100 15.00CR 15.00CR
Totals 45.00CR 45.00CR
Whereas Bob L's query isn't even possible - you can't do join selects to
constants, so you can't "join only credits" or "join only debits" (which
were IDed, as I recall, by a value in a particular field in the Detail not the
Master file).
Sadly (at least from a simplicity/elegance standpoint) multiple queries as
suggested by David K. is the only way I've ever been able to resolve
just this problem using Query.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the Midrange System Mailing List! To submit a new message, *
* send your mail to "MIDRANGE-L@midrange.com". To unsubscribe from *
* this list send email to MAJORDOMO@midrange.com and specify *
* 'unsubscribe MIDRANGE-L' in the body of your message. Questions *
* should be directed to the list owner / operator: david@midrange.com *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.