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!

Count of Month and Year

Status
Not open for further replies.

mmwdmr

Technical User
Jan 10, 2002
119
0
0
US
Using Crystal 10 & SQL database:

This should be simple. My first group is on employee name. My second group is on transaction date (with the by month option). I have a summary count of the date details (how many transactions) but I also need to count the number of distinct months/year for each employee. For instance, I need a count of 5 total months and 54 total transactions:

Smith
January 2004 14
May 2004 10
November 2004 5
February 2005 9
January 2006 16
5 months 54 transactions

Anyone? Thanks!
 
Create these formulas:

//{@reset} for the group header (employee):
whileprintingrecords;
numbervar mos := 0;

//{@accum} to be placed in the group header (month):
whileprintingrecords;
numbervar mos := mos + 1;

//{@display} to be placed in the group footer (employee):
whileprintingrecords;
numbervar mos;

-LB
 
That's pretty much what I ended up doing. Thanks for the reply.
 
Next time, look first to see if a Crosstab will do it. That's the sort of thing they are good at, and with Crystal 10, you can sometimes use formula fields.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks Madawc - that would be a good thing to try next time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top