Search code examples
sqlvisual-studioreporting-servicesssrs-2008

CountDistinct with SSRS


Hey guys i have a report I am writing that is pulling trucks, order numbers, and charges from different tables. I am running into a problem when it pulls more than one truck for the same order it doubles or triples the price. My plan to resolve this is to write an expression to calculate the charge that goes along the lines of Fields!amount.value / CountDistict(truckColumn) But it is not working and I am not sure of the best route to take from there of if this is the best solution. Any help would be great.


Solution

  • How you tried writing it as this:

    =Fields!amount.value/(COUNTDISTINCT(Fields!TruckColumn.Value))