Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Report not working after concatenation of fields.


Report not working after concatenation of fields.

Author
Message
dbman
dbman
SSC-Enthusiastic
SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)

Group: General Forum Members
Points: 127 Visits: 1537
Hello everyone,

I am having problems running a report after making a change to concatenate two fields.

I have a report with parameters. @StartDate, @EndDate, @ShipperNo, @ServiceType.

I have a dataset called Distinct Account. The query is as follows:

SELECT DISTINCT Deliveries.ShipperNo + ' ' + ShipperName.AccountName AS ShipperNo
FROM Deliveries LEFT OUTER JOIN
ShipperName ON Deliveries.ShipperNo = ShipperName.ShipperNo
ORDER BY ShipperNo


Previously my query was: Select Distinct Deliveries.ShipperNo FROM Deliveries

This query picked up all the shipper nos which enabled my report to run.


I have now joined to the ShipperName table to get the Account Name and to able to concatentate two fields: ShipperNo and ShipperName.

On my parameter ShipperNo i have selected Allow Multiple Values.

On my Parameter ShipperNo Under Available values I have selected Get Value from a query.


DatasetBigGrinistinctAccount

Value Field: ShipperNo

Label Field: ShipperNo



When i run my report on my multiple dropdown list for Shipper No, it looks as follows:


336152 Granger
373733 Hartley


Previously my report ran correctly when not using concatentation. I am now finding that my report is not returning any data at all.

Am i doing something wrong?


Thanks
dbman
dbman
SSC-Enthusiastic
SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)

Group: General Forum Members
Points: 127 Visits: 1537
Any ideas?
TaylorMade
TaylorMade
SSC-Addicted
SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)

Group: General Forum Members
Points: 486 Visits: 210
Firstly, does running the join query in SMS result in having lots of records, or just the 2 you listed.

At first glance it appears as if it were working as an INNER join, not an OUTER, however I believe that you may be confusing SSRS with that way you setup the values/label for the dropdown and in your query. Here is how I would do it more clearly:

1. The dataset shoulld contain two fields

SELECT DISTINCT Deliveries.ShipperNo, Deliveries.ShipperNo + ' ' + ShipperName.AccountName AS ShipperLabel
FROM Deliveries LEFT OUTER JOIN
ShipperName ON Deliveries.ShipperNo = ShipperName.ShipperNo
ORDER BY ShipperNo

2. Then for the parameter field, set the Value Field: ShipperNo and the Label Field: ShipperLabel

Hopefully that will help, good luck.
dbman
dbman
SSC-Enthusiastic
SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)

Group: General Forum Members
Points: 127 Visits: 1537
Thanks for you help. Problem solved Smile)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search