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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable 1

Status
Not open for further replies.

dbltt25

MIS
Nov 29, 2000
28
0
0
US
I have the following formula on a subreport that I am passing the count back to the main report (or at least trying to do):

WhilePrintingRecords;
global numberVar x := 0;
numbervar y := 0;
if (Count ({Cpfind.INTID},{Cpfind.INTID}) > 1) then (y = y + 1);

STORENUMBervar("x", y);

The Y+1 does not seem to be working and I am wondering if anyone can see something that I am missing. Even when the database meets the conditions for the count, all I get is a 0 when I fetch the variable on my main report.

I am hopefully just missing something simple. Any thoughts??

I am running Crystal 7 off from a Dbase database if this helps at all.

Thanks for all the help

 
dbitt25: Your problem may be that you are counting the same field you are grouping by. As a result there can only ever be one instance of the field per group (unless you're using specified order). Try counting something else which repeates within the group or group by another field David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
change
...then (y = y + 1)
to
...then (y := y + 1)

After you do this a few hundred times, it gets easier to notice :) Malcolm
 
Thank-You MalcomW!! It works like a charm now... Amazing
X-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top