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

Insert totals/subtotal with whileprintingrecords

Status
Not open for further replies.

UHsoccer

Programmer
Apr 24, 2003
139
US
The selection to insert subtotals/totals is available when I use logic like

if month(date({Care.Date})) = 4 and year(date({Care.Date})) = 2006 then {Time.Hours}

It is NOT selectable when I use

whileprintingrecords ; numbervar mStart ; numbervar yStart;
if month(date({Care.Date})) = mStart and year(date({Care.Date})) = yStart then {Time.Hours}

Do I need to "manually" create subtotals and totals in the second method?

 
We don't know what you have set mStart or yStart to. First, try just removing the "whileprintingrecords" and see if that meets your needs.

-LB
 
If the "whileprintingrecords" line is removed, then the mStart and yStart are not available anymore.
They are defined in a different segment

Is there possibly a way to define variables w/o the whilprinting stuff?
 
We need to see how you are initializing mSTart and yStart.

-LB
 
Here is a copy of the code

whileprintingrecords ; numbervar mStart ;numbervar mEnd ;
numbervar yStart ;numbervar yEnd ;


mStart := m(date({Projects.ProjStartDate})) ;
mEnd := m(date({Projects.ProjEndDate})) ;

yStart := y(date({Projects.ProjStartDate})) ;
yEnd := y(date({Projects.ProjEndDate})) ;
 
What do the m's and y's represent--months and years??? Why do you say they are defined in a "different segment"--do you mean a different report section? And if so, why? I don't see the need for variables at all so far.

-LB
 
A thank you is in order to "lbass"

Aprriciate your persistance, I now realize that I was making it more complicated than it needed to be.

Coming from a different progamming background, I am used to "setting up variables", then using them later.
InCrystal that eliminated the "Insert SubTotal" option because I was using "whileprintingrecords" everywhere

Thanks again

By the way, the formula should have read

mStart := month(date({Projects.ProjStartDate})) ;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top