Someone else mentioned doing the totals with some reporting tool. Otherwise, you have to use some "interesting" value like 9,999,999 to get the sort right when doing a UNION SELECT - and in this case, you couldn't use a true date data type.
Query management queries and forms are a good tool for this and are included on any box that has STRSQL. Otherwise, you can look at products like SEQUEL and a few others. Of course, good old Query for IBM i can do it, too. But you don't get the nice SQL SELECT statement capability.
This mailing list archive is Copyright 1997-2013 by MIDRANGE dot 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 here. If you have questions about this, please contact