Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with variables in formula

Status
Not open for further replies.

dgillz

Instructor
Mar 2, 2001
10,045
US
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
 
Answered my own question. I had to replace the else with a semicolon ;

If I could give myself a star, I would :)


Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
askdon@srhconsulting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top