Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem - Average is not a whole number.
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00177228
Message ID:
00177258
Views:
36
>In my report I print an Average at the Group Footer level. The average is appearing as 27.666666. My report content is built by a SELECT command with a cursor named RPT as the output of the SELECT statement.
>
>I would like it to read 27 without the decimals.
>
>My Group Footer Report Expression Window shows expression -
>INT(CTOD(rpt.EndDate) - CTOD(rpt.StartDate))
>
>I have tried FLOOR(), CEILING(), INT(), etc., but no help.
>
>My Calculate Field Window shows -
>Reset: rpt.status
>In other words, I calculate the average number of days elapsed whenever the status code changes.
>Calculate - Average radio button is clicked on.
>
>I want to report the Average Number of Days Elapsed.
>
>My Detail Report Expression Window shows expression -
>CTOD(rpt.EndDate) - CTOD(rpt.StartDate)
>The number of days elpased for a certain status code record.
>
>Any idea what's wrong?

Yes - while each computation is an integer, the average is being computed by dividing the sum of the integer values by the count of the integer values in the group. You'll have to coerce the result into an integer for display purposes; this is most easily done by using a format with no decimal places. This will force the decimals to truncate rather than providing a correctly rounded integer value that more accurately reflects the mean, but it doesn't sound like that matters.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform