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 # of days in a month data > 0

Status
Not open for further replies.

lndoan

IS-IT--Management
Jun 30, 2005
28
US
I would like to count the number of days in a month if the each day's data is > 0. I'm using this formula:

whileprintingrecords;
numbervar countdays;

if Sum ({@Pax01}) > 0 then
countdays:= count ({@Pax01},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax02}) > 0 then
countdays:= count ({@Pax02},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax03}) > 0 then
countdays:= count ({@Pax03},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax04}) > 0 then
countdays:= count ({@Pax04},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax05}) > 0 then
countdays:= count ({@Pax05},{RPT_TRIPS.Schedule ID})

... and so on all the way down to ({@Pax31}) for passenger counts up to 31 days.

It works fine for 1 route (a,b,c,d,e....) if i added route b so the parameter is selecting for route a & b, the days is not calculating correctly.

 
Hi,
Not enough info to tell what's up..

What do you mean by
if i added route b so the parameter is selecting for route a & b, the days is not calculating correctly.

What is the incorrectness?

Are you grouping by Route?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Report is grouped by train routes, then by train directions (inbound/outbound). The formula is in the group footer for train direction. The parameter i have list all the routes as a selection criteria. If i chose only 1 route, the formula will calculate all the days for the month of for example October that has passenger data greater than 0 which it comes out to 21 days.

If i added the second route when i prompt for new data using the paramater, the first route calculations is correct but the second shows 5 days, it should be 21 days no matter how many routes i've added to my parameter selection.

Hope this helps... thanks

- Linda
 
Please respond to the suggestions in your similar thread149-1150686 instead of starting new ones on the same topic.

-LB
 
I apologize and might have forgotten that I posted a thread on this subject prior.

I still need some assistance on this subject if anyone out there have recommendations.

Thank you
- Linda
 
I see that I referenced the wrong thread. Please respond to the suggestions in thread767-1153852.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top