THANKS! That helped a bunch. Ron Power Programmer Information Services City Of St. John's, NL P.O. Box 908 St. John's, NL A1C 5M2 709-576-8132 rpower@xxxxxxxxxx http://www.stjohns.ca/ ___________________________________________________________________________ Success is going from failure to failure without a loss of enthusiasm. - Sir Winston Churchill Kenneth McMenamy <onedble0@xxxxxxxxx> Sent by: java400-l-bounces@xxxxxxxxxxxx 2007/03/07 11:03 AM Please respond to Java Programming on and around the iSeries / AS400 <java400-l@xxxxxxxxxxxx> To Java Programming on and around the iSeries / AS400 <java400-l@xxxxxxxxxxxx> cc Subject Re: SQL In Java You can simply include this in your SQL logic: Select Name , tradeName , Case When Name <> ' ' Then Name Else tradeName End As Sort_Field From someFile Order By 3 Ron Power <RPower@xxxxxxxxxx> wrote: Not sure if I'm in the right list for this question but... is it possible to join two files by a Roll Number, then order the resultset by two different fields? Example: I have two files on the iSeries. One is a master, the other is a supplementary file that contains extra information. They are joined by a roll number (15 digit number assigned to a property). The master file has a name field and the supplementary file has a trade name field. Sometimes the name field contains the business name, sometimes the trade name field does. I want to get a result set that sorts the files where if the trade name field is populated to use that in the sort otherwise use the name field in the sort. So if we have the following files: Record1: Name="aaa" tradename="" Record2: Name="aac" tradename="" Record3: Name="aad" tradename="aab" So that they output in the following order: Record1 Record3 Record2 Thanks, Ron Power Programmer Information Services City Of St. John's, NL P.O. Box 908 St. John's, NL A1C 5M2 709-576-8132 rpower@xxxxxxxxxx http://www.stjohns.ca/ ___________________________________________________________________________ Success is going from failure to failure without a loss of enthusiasm. - Sir Winston Churchill This email communication and accompanying documents is intended only for the individual or entity to which it is addressed and may contain information that is confidential, privileged or exempt from disclosure under applicable law. Any use of this information by individuals or entities other than the intended recipient is strictly prohibited. If you have received this in error, please notify the sender and delete all the copies (electronic or otherwise) immediately.
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.