Re: ACE ordering problem
Posted in 1992
Path: emory!europa.asd.contel.com!uunet!psinntp!eco.twg.com!twg.com!cauhape From: cauhape@twg.com (Jeff KB6TDU Cauhape) Newsgroups: comp.databases.informix Message-ID: <10023@gollum.twg.com> Date: 27 Jan 92 18:32:38 GMT References: <1992Jan24.163613.12815@midway.uchicago.edu> Organization: The Wollongong Group, Palo Alto, CA admn@quads.uchicago.edu (Bonnie J. Black) writes: > I am trying to write an ACE report which draws little charts >showing the newsstand distribution of each of the issues of a year >for the various distributors. The program orders the information by >distributor first, then within the report on each particular distributor, >I want to have the report print out the issues in chronological order. >My problem is that I cannot tell the program to sort secondarily by >issue because they're character fields, and they come out like this: > APR > DEC > J/A (Jul/Aug) {alphabetical order} >instead of like this. ... > J/F (Jan/Feb) > MAR > APR {chronological order} ... >Bonnie J. Black (admn@midway.uchicago.edu) Bonnie, When you are selecting your data, include a string litteral along with the issue field based on the value of the issue field. ex: select ... issue, "A", ... where issue matches "J/F*" select ... issue, "B", ... where issue matches "MAR*" You will need to either do multiple selects into a temp table and then do a select from temp in sorted order, or do a union with the multiple selects and then use group by. Sorry if this is off of the top of my head, but it is a solution you might look at. PS: The union method is ssslllllooooowwwww... ---------------------------------------------------------------------------- Jeff Cauhape cauhape@TWG.COM 415/962-7147 Room 224 (SneakerNet) "I haven't lost my mind. It's backed up on tape somewhere." ----------------------------------------------------------------------------