I'm trying to join a master record to a detail file in which there may be 0
- 2 matching records and turn it on it's side. I can easily do this if
there are always two matching records but can't figure out how to handle
the other two situations (no matching or just one matching). The end
result should look like this:

Acct#, Day1, Day2

Master record has account# and other needed information for final results.

Detail record has account# and Day which is 1 -31.

Results could like this:

Acct#, Day1, Day2
1 1 15
2 1 0
3 0 0

Day1 should be lesser of both days.

It's straightforward if both detail records are there using group by with
Min and Max. We're still on 5.4 and at least a month away from 7.1.


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by 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].