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

Grouping of same fields on Week, Month, and Year show exact same value

Status
Not open for further replies.

Tweaki

Technical User
Jun 15, 2005
11
CA
Help Please!

Crystal Reports v10.0

I have a number of fields (for example, kilometers driven, number of loads, hours driven, etc.) that I'm trying to show either a count or summation per time period, IE -- on a weekly, monthly, and yearly basis. My problem is that these fields are displaying the exact same values no matter what group the field is in. And I KNOW I have information on all these fields for at least 6 months. What other information can I give........I'm suppressing the weekly grouping with the following formula:

if {v_targ_Hauling_ProductionvsTarget.workdate} > {?EndingDate}then true

Please let me know if I can provide any other info. Thanks so much.

T.
 
How are you totalling by on a weekly, monthly, and yearly basis? Is it by group? (which can be done using Year({your.date}) and Month({your.date})).

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Not entirely sure what you mean, but I'll tell you what I'm doing: in the correct group section I right click on the field I want to total (say I want the weekly count for job numbers). I select edit summary, and then the Edit Summary dialogue box comes up, it select the field v_targ_hauling_productionsvstarget.jobnumber in the first drop down box, and then in the second drop down box, I select count. Does that help?
 
Are your totals summarising the right groups?

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Sorry? How would I confirm that my totals are summarizing the right groups? (I'm a CR newbie).
 
It would probably help to mention that this report relies on three parameters: end date, Division, and Equipment type. The only time I get this problem is when both Division and Equipment are set to "all". Either one of them can have a parameter value of "all", and the report comes up correctly, this problems occures when both of those parameters have "all" as the parameter value.
 
OK -- found part of the problem -- My record select formula has three statements in it. The third and final statement basically says only bring back the last 7 days work of data from the end date parameter.

My next question is that I have a sneaking suspicion that the Record Select expert is not recognizing all three statements, even though I have ended all three with a semi-colon to indicate an end to a statement. Is there another way to do this? Using an "and" for concatenation or something?

Thanks in advance.

T.
 
Please post your Record Select code. You get that from Report>Selection Formulas>Records, and you may spot it yourself when you see the code as a whole.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
if{?Division}<> "LIKE '%'" then
{v_targ_Hauling_ProductionvsTarget.emp_department} = {?Division}
else {?Division}= "LIKE '%'"

and

If {?Equipment} <> "LIKE '%'" then
({v_targ_Hauling_ProductionvsTarget.groupcode} = {?Equipment} and {v_targ_Hauling_ProductionvsTarget.funccode} = 4)
else {?Equipment}= "LIKE '%'"
 
Not sure what this is intended to do as I just read the last post, but I doubt that it's doing it, so try:

(
if{?Division}<> "LIKE '%'" then
{v_targ_Hauling_ProductionvsTarget.emp_department} = {?Division}
else
if{?Division} = "LIKE '%'" then
true
)

and

(
If {?Equipment} <> "LIKE '%'" then
(
{v_targ_Hauling_ProductionvsTarget.groupcode} = {?Equipment}
and
{v_targ_Hauling_ProductionvsTarget.funccode} = 4
)
else
If {?Equipment} = "LIKE '%'" then
true
)

btw, the like predicate in Crystal is *, not %, so it would be:

{?Equipment} LIKE '*'

Forget the quotes you were attemtping as well.

Once you've completed the record selection, check the Database->Show SQL Qeury to learn what the database is being passed.

-k
 
Thanks Madawc and Synapse, appreciate all the info!!

T.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top