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!

Checking a code field for a value then adding to a total field

Status
Not open for further replies.

hunterok

Programmer
Oct 8, 2009
2
US
I have a report with rows of data in a dataset grouped by a CUSTOMER number then a VEHICLE number. In the data row is a COST TYPE code like 'L' for labor 'I' for inventory, etc.., and a dollar amount field associated with the COST TYPE. The report needs to list a customer then the vehciles for that customer. Then if the COST TYPE code is equal to 'L' add the cost amount to a total and when the vehicl number changes list on the report the total dollars associated with COST TYPE 'L'.

It allows setting up a DATASET field named TypeL as below:

=iif (Fields!wmdt_cost_type.Value = "L", Fields!wmdt_billed_amt.Value, 0)

It also allows listing on a detail line the individual dollar amounts.

But it won't allow a SUM of the amounts as below.

=Sum(Fields!TypeL.Value,"MilesBillAmts")

The report will run but it prints #ERROR where the expected total dollar amount of the COST TYPE = 'L' for this vehicle should print.

In SQL Reporting Services how do you check for a value in a COST TYPE field and then create and print a TOTAL dollar amount field associated with that COST TYPE??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top