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

Counting same day occurences.

Status
Not open for further replies.

Jacque

Technical User
Nov 9, 2001
301
US
I need to count same day occurrences and display the count within a user defined date range. I'm the shackled with having to group by homebase, item, location(within the homebase) and date. If I could leave out the group by location - no problem but...according to the original developer, this grouping must be maintained. It was originally designed using a subreport which included 3 groups: homebase, item and date but because it did not include the location, when the user specified the date range, the report did not reflect the subreport date portion correctly, it would only pass the homebase and item parameters correctly. As long as one of the dates was within the user specified date range, all dates in or out of the date range would appear.

This is what I want to see:
HOMEBASE...
ITEM.....
LOCATION...
1/31/02 [2]
2/01/02 [1]


Here is what I currently see when trying to redesign without using a subreport:
1/31/02 [1]
2/01/02 [1]
1/31/02 [1]
HOMEBASE...
ITEM.....
LOCATION...
I've tried underlay'ing but it doesn't appear to work in this instance(?) and if I move the date format to the group footer, I just get the last date.

Any help with reworking the original report or redeveloping the report would be appreciated.
X-)
 
jacque,

It sounds like you need to have a look at using variables.

In your subreport example - we can use "shared" variables, allowing both the main and all subreports to access, and change values stored in such a variable.

To use a shared variable:

1. Declare the variable in the subreport: ie:
shared numbervar MyNumber;
2. Assign a value to it: ie:
MyNumbervar:= Count({db.date},{db.location})

3. Declare the same shared variable in a formula in the main rpt
shared numbervar MyNumber;

4. Use the variable - it will already contain the value stored in the subreport

5. If you are using this for groups - remember to initialise or "zero" the variable to clear the contents before using it again.

I hope this helps

paulmarr
 
Thanks Paulmarr,
I did try using variables but had the same issue with not getting the correct date qty results or getting confused at where to re-initialize the variable, what did work was using a crosstab in the groupfooter where I was displaying the data and using a conversion date formula for the row.

This is a great forum, thanks for all your help.*:->*
Jacque
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top