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

Crystal Reports 9 - Prevent adding of negative numbers

Status
Not open for further replies.

cndavis34

IS-IT--Management
Jun 16, 2004
25
US
I'm currently modifying a manhour report with Crystal Reports 9 for Wind2. For whatever reason, the project managers do not want negative manhours added into the grand total. Can anyone tell me how you would prevent it from adding negative numbers to the grand total? Please keep in mind that I am a newbie to Crystal. Any help would be greatly appreciated.
 
How are you adding the numbers? If you are inserting a summary, then replace the field you are inserting the summary on with a formula, and insert the summary on the formula:

if {table.amount} < 0 then 0 else
{table.amount}

-LB
 
create a running total and in the evaluate section use a formula that only adds positive numbers..

example using crystal syntax:

{testtable.fieldtoadd} > 0
 
If you don't need the negative hours records for anything else, you could omit them in your "record selection" formula.
MrBill
 
I probably should have put the examples below in my original posting......

Example of what it does now.....
Engineering | Drafting
Project Budget Hours Total |Budget Hours Total
Number Used Remaining |Number Used Remaining
---------------------------------------|------------------------
20000 325 350 (25) | 216 547 (331)
30000 119 118 1 |81 79 3
---------------------------------------|------------------------
Total Hours Remaining (24) | (328)

Example of what the Project Managers want displayed.....
Engineering | Drafting
Project Budget Hours Total |Budget Hours Total
Number Used Remaining |Number Used Remaining
---------------------------------------|------------------------
20000 325 350 (25) | 216 547 (331)
30000 119 118 1 |81 79 3
---------------------------------------|------------------------
Total Hours Remaining 1 | 3
 
Any one of the above solutions should work for you, so what is the current issue?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top