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

Re: Sort on calculated field



Oracle 7.3.3.2
SQRW 3.0.18.1.1

If you select it , you can do an 'order by' on it.  See the following:

  REG_HRS    OT_HRS (OT_HRS/REG_HRS)
--------- --------- ----------------
       10        10                1
      -10       -10                1
      -20       -10               .5
       20        10               .5
       20        10               .5
      -20       -10               .5
       40         0                0
       80         0                0
    54.67         0                0

9 rows selected.

SQL> l
  1  select reg_hrs, ot_hrs, (ot_hrs / reg_hrs)
  2  from ps_pay_earnings
  3  where reg_hrs <> 0
  4* order by (ot_hrs / reg_hrs) desc

Richard Tomancik
richard_tomancik@tiginsurance.com





Darwin Anderson <dander03@AVIS.COM> on 10/02/98 08:35:35 AM

Please respond to SQR-USERS@USA.NET

To:   Multiple recipients of list SQR-USERS <SQR-USERS@list.iex.net>
cc:    (bcc: Richard Tomancik/Consultant/Dallas/TIG)
Subject:  Sort on calculated field




Sybase 11.0.2.1
SQR 3.0.13.2

How can I sort in descending order on a field that is created
by a calculation during processing?

I have existing fields for regular hours and overtime hours
from which I calclulate the percent of OT to Regular.  When
the report is printed, I want the highest percentage to be on
the first line.

I suspect that I need to use a bind variable in some way.

TIA

Darwin
dander03@avis.com
516-222-3064