[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Order By Problem



The "As is" table is how the data is ordered in the database. The "I need to
order by" section is how I need the order by to sort the data, either using
the Code field or the Description field. The problem is there is no simple
numerical or alphabetical solution.
Dave Benzenhafer

-----Original Message-----
From: Enis Koral [mailto:ekoral@ATT.NET]
Sent: Thursday, February 22, 2001 1:23 PM
To: SQR-USERS@list.iex.net
Subject: Re: Order By Problem


Your order looks random to me. What is the logic behind
it, just looking at the data doesn't tell much.
You have column1 (number) column2 (text). What is the
order by text? or number? or combination?

> Below you can see the other field associated with the number code. I need
to
> Order By on this Criticality field. I hope this helps to explain.
>
> As is               I need it to order by like this
> 10489 Shutdown            10492 Safety
> 10490 Critical            12473 Safety Critical
> 10491 Normal              10489 Shutdown
> 10492 Safety              12553 Op Critical
> 12473 Safety Critical     10490 Critical
> 12474 Operational Std     12474 Operational Std
> 12475 On Request          10491 Normal
> 12553 Op Critical         12475 On Request
>
> Dave Benzenhafer
>
> -----Original Message-----
> From: Rick_Creel@AONCONS.COM [mailto:Rick_Creel@AONCONS.COM]
> Sent: Thursday, February 22, 2001 12:26 PM
> To: SQR-USERS@list.iex.net
> Subject: Re: Order By Problem
>
>
> What kind of order are you wanting?  What you want looks like random order
> to
> me.  Are there any other fields that help determine the order?
>
>
>
>
>
> "Benzenhafer, Dave" <DBenzenhafer@DEEPWATER.COM> on 02/22/2001 01:06:37 PM
>
> Please respond to sqr-users@list.iex.net
>
> To:   SQR-USERS@list.iex.net
> cc:    (bcc: Rick Creel/IT/Aon Consulting)
>
> Subject:  Order By Problem
>
>
>
> I have a number field that I would like to change the sort order by
without
> creating another table to sort by if possible. Not all of the numbers show
> up in every report. The Table the field comes from looks like this.
>
> As is           I need it to order by like this
> 10489                   10492
> 10490                   12473
> 10491                   10489
> 10492                   12553
> 12473                   10490
> 12474                   12474
> 12475                   10491
> 12553                   12475
>
> I have tried instr() without much success. Is it possible to use something
> like the instr() function to change the sort order of a field.
>
> Thank You in advance for you help and time.
> Dave Benzenhafer