Birgitta's works also.

Get in the habit of using AS, especially in summations.
Like
select count(*) as TheCount...
This will rename your fields (excuse me, columns).

Might want to try it in a view that the users use to make the selection
more readable.
For example, instead of telling the users to join this file to this and
this and that for a Query/400 query then just create this

CREATE VIEW QTEMP/OPENORDERS AS (
SELECT HCUST AS CUSTNBR,
HORD AS ORDERNBR,
HCPO AS CUSTPONBR,
LLINE AS ORDERLINE,
LPROD AS ITEMNBR,
LCLAS AS ITEMCLASS,
LQORD - LQSHP AS QTYLEFT,
NUMTODATE(LRDTE) AS DATEREQSTD,
CASE LSTAT
WHEN 'E' THEN 'DESC1'
WHEN 'I' THEN 'DESC2'
WHEN 'P' THEN 'DESC3'
ELSE 'DESC4'
END AS LINESTATUS,
LDESC AS ORDLINDESC,
CNME AS CUSTNAME,
CSAL AS SLSMANNBR
FROM GDIDIVF/ECH
LEFT OUTER JOIN GDIDIVF/ECL ON HORD=LORD
LEFT OUTER JOIN GDIDIVF/RCM ON HCUST=CCUST
)

Rob Berendt

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].