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!

Calculated field in report not show correct decimals

Status
Not open for further replies.

ColumbiaDiver

Technical User
Jul 27, 2002
35
0
0
US
Hi All,

Hoping someone can help me with an issue I am having with a report I wrote for one of my departments.

The report is an audit report to verify that all that all the records for players in a charity golf tournament are being pulled correctly by the application before the user moves onto the next step.

The teams consist of 3 individuals each, the report prints a list of all players in each team sorted by the sponsoring company or individual.

At the bottom of the report I added a field to do a count on the player name field so the user can see the number of records pulled, which also happens to be the number of players as the table the report is based on only contains players. The count is Count(Master.PRT_NAME). For the test I am doing it returns a total of 148 records, which is correct.

The next field I created lists the number of teams. This allows the end user to determine if all the teams are being pulled correctly. I created a calculated field which is

Count([MASTER.PRT_NAME])/3 The number format for the field is set to Windows# ie xx.xx.

If results of this calculated field is an even number then youre golden, if not then youre missing player(s) from one of more teams and need to go back and check your data entry.

When I run the report against my test table it returns the correct number of records, (players) 148, but the calculated field for the number of teams shows up as 49.00 which is incorrect as 148/3 equals 49.33333, I only need a two digit decimal as any uneven number is sufficient to show there are missing players.

I have tried the various different available number formats for the field and none of them show the correct value.

Can someone give me some insight into what I am doing wrong/missing?

Thanks

Gordon
 
Just a thought and I haven't tested it,
Count returns an integer data type, Performing the division Count([MASTER.PRT_NAME])/3 will likely also imply a return value that is an integer. Can you use the NUMBER() function in the calculated field(I haven't tried) Maybe the calculation would look like this Number(Count([MASTER.PRT_NAME]))/3

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top