I have a report that needs to display accounting data from different locations or all locations.
Table_sales:
PartId Rev LocId
1 $10 1
2 $2 1
3 $5 2
Lets say the query is something basic like this to get all revenue:
SELECT SUM(rev) FROM Table_sales
If I want to be able to limit the report to a particular Location I would have to change it to:
SELECT SUM(Rev) FROM Table_sales WHERE LocId = @param
But if I did that how would I get all locations without having multiple queries?
FYI the SQL 2008 Filter option doesn't seem work on the actual query I am using since the actual query uses group by functions.
Also SSRS 2008 DataSet queries can be expressions, but I can't seem to get that to work.