Re: HELP! How can I do a two-fer?
Posted in 1994
tcarroll@netcom.com (Tom Carroll) writes: >I have a client who needs a report modified in Informix 3.3. The >existing report sorts by customer_name, then by ticket_number. I need >to also give him the data sorted out by ticket_number. Can I have two >sorts in one report? So far ACEPREP won't go for it. I don't want him >to have to learn or do anything new, so getting it all from the same >report would be ideal...Any ideas??? I think (hope) ACE can handle a UNION: SELECT 1 srt, customer_name scname, customer_name, ticket_number ... UNION ALL SELECT 2 srt, "0" scname, customer_name, ticket_number ... ORDER BY 1, 2, 4 So that the first group of rows (where srt = 1) will come out first, sorted by customer_name and ticket_number, then the seconde group of rows (srt = 2) will sort all scname together (= "0"), and the real sort by ticket_number. You can still report the customer_name in the 2nd group (which is why we select customer_name twice). This is untried in ACE, but even if the exact example doesn't work, you might get some other ideas using UNION. ======================================================================= Dennis J. Pimple dennisp@informix.com Opinions expressed Senior Consultant -------------------- are mine, and do not Informix Software Inc Voice: 303-850-0210 necessarily reflect Denver Colorado USA Fax: 303-779-4025 those of my employer.