|
Hello,
I'm trying to figure out a way to create a sort field that will have
different values based on the value of different fields in each record
retrieved by a SQL statement in a RPG program. For example, if the
record returned has a "P" in the hinge field, I want this record to have
a sort value of 3. Else if the height is greater then 72, then the sort
value should be a 2. Else if the width is greater then 48, then the
sort value should also be a 2. If none of these conditions are true,
then the sort field should have a value of 1. Then I would like to use
the sort field in the ORDER BY clause.
I'm not having any luck figuring out how to create the condition syntax
and getting the sort field to work.
Any help is greatly appreciated.
Thanks,
Kent
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.