I have a report with a list of items and quantities, grouped by item. In the group footer, I want to put the first and last quantities found. So a wrote the following formula and placed it in the details section:
WhilePrintingRecords;
If {IMINVTRX_SQL.Trx_Dt}=minimum({IMINVTRX_SQL.Trx_Dt},{IMINVTRX_SQL.Item_No})
then Numbervar FirstQty:={IMINVTRX_SQL.Quantity} else
If {IMINVTRX_SQL.Trx_Dt}=maximum({IMINVTRX_SQL.Trx_Dt},{IMINVTRX_SQL.Item_No})
then Numbervar LastQty:={IMINVTRX_SQL.Quantity}
I am resetting the variables in the group header, and displaying them in the group footer.
The problem I am having is that if my group has only one record, the LastQty variable has a value of zero and I cannot figure out why. In groups where there are multiple records, the formula works fine.
Any insight appreciated. I know this has got to be something easy.
Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
askdon@srhconsulting.com
WhilePrintingRecords;
If {IMINVTRX_SQL.Trx_Dt}=minimum({IMINVTRX_SQL.Trx_Dt},{IMINVTRX_SQL.Item_No})
then Numbervar FirstQty:={IMINVTRX_SQL.Quantity} else
If {IMINVTRX_SQL.Trx_Dt}=maximum({IMINVTRX_SQL.Trx_Dt},{IMINVTRX_SQL.Item_No})
then Numbervar LastQty:={IMINVTRX_SQL.Quantity}
I am resetting the variables in the group header, and displaying them in the group footer.
The problem I am having is that if my group has only one record, the LastQty variable has a value of zero and I cannot figure out why. In groups where there are multiple records, the formula works fine.
Any insight appreciated. I know this has got to be something easy.
Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
askdon@srhconsulting.com