Today's Millennium Tip

“Order entry exceeds max of (8) order entries allowed” Error

Previously, we discussed using a zero (0) as the last item in your Order statement to make “Select Distinct” work properly.  In this tip, we’re going to discuss an error message that you could encounter relating to the “Order” statement.

CCL, in Classic, would allow you to have 10 items in your Order statement (not counting “Head Report” and “Head Page”).  In Millennium, however, you are limited to only 10 items, including “Head Report” and “Head Page” and they are automatically included in your “Order” statement regardless of whether you actually type them into your source code or not.

Consequently, the following code snippet will fail with the above error:

ORDER

PERSON_ID,

ENCNTR_ID,

STATUS_ORDER,

CNVTDATETIME(O.CURRENT_START_DT_TM) DESC,

MED_ORDER,

OI.ACTION_SEQUENCE DESC,

OI.COMP_SEQUENCE,

ADDON_ORDER,

OD.ACTION_SEQUENCE DESC

The same is also true of the code snippet below.

ORDER

PERSON_ID,

STATUS_ORDER,

CNVTDATETIME(O.CURRENT_START_DT_TM) DESC,

MED_ORDER,

OI.ACTION_SEQUENCE DESC,

OI.COMP_SEQUENCE,

ADDON_ORDER,

OD.ACTION_SEQUENCE DESC,

            0

There are several solutions for this error.  The simplest is to reduce the number of elements in the “Order” statement.  If this is not possible, you can create a variable in your “Select” statement that combines 2 or more of the elements in the “Order” statement and use this variable in the “Order” statement.

If you are interested in other solutions to this issue, or if you have a particular problem relating to this, please feel free to contact us.

 

Paladin Consulting Group, LLC.
Copyright © 2002 Paladin Consulting Group, LLC. All rights reserved.
Revised: May 01,2004.