I have a report that I am working on that will do the following:
- Return results based first on the community selected by the user.
- Filter to find alike addresses within the community, based on the number of square feet at each address.
- Set the end date (a column within the data table) to a user defined parameter for use in a WHERE at the end of the query.
The relevant information is stored in the following places:
- Community: ub_subdivision.descr
- Address: ub_serv_loc_addr.location_addr
- SqFt: arp_ops.dbo.vw_ub_serv_loc_classifications.SqFt
I have setup the query with 3 parameters:
- @Community
- @Months
- @Address
When the user is running the report, the following should happen (in this order):
- The community parameter should populate the values stored in
ub_subdivision.descrand allow the user to select the community they want from that list. - The address parameter should populate the values within the selected community from step 1, and allow the user to select the address they want from that list.
- Based on the selected address, the query should store the value of the
SqFtrelated to this address and use that in the WHERE statement as follows:WHERE (arp_ops.dbo.vw_ub_serv_loc_classifications.SqFt = @Address) - The months parameter should allow for user input to define how many months of data they want. This parameter is called in the query in the WHERE statement:
WHERE (ub_bill_run.def_end_dt > DATEADD(m, -@Months, GETDATE())).
If I save the dataset and create a "table report" in Report Builder 3.0 it does the job of recognizing the various parameters and loading them into the Parameters folder and into the Datasets' parameters.
The problem I have is that I am not able to change the parameter properties to display Available Values and select "get from a query". If I go this route, and try to run the query I get an error that I am using "forward dependencies".
I need the @Address parameter to display the address field as the label, but store the sqft field as the value. This is the way I know how to do this and, unfortunately, it doesn't seem to work.
I would appreciate any insight anyone may have.
Thanks! John