Apologies if this has been asked before, I combed through a lot of questions but wasn't able to find an answer I could apply to this problem.
I'm putting together an SSRS report from a database I have read-only access to and am having trouble selecting the data in the format I would like.
Table 1: Referenced Data
==== =============
ID Description
==== =============
1 Apple
2 Orange
3 Pear
==== =============
Table 2: Records
==== ====== ========
ID Data Tag
==== ====== ========
1 1 List
2 2 List
3 Red String
4 Blue String
5 3 List
==== ====== ========
What I would like to see is:
Report
========== =========
RecordNo Content
========== =========
1 Apple
2 Orange
3 Red
4 Blue
5 Pear
========== =========
The problem is the Data column of T2 is nvarchar while the ID column of T1 is bigint. While I can avoid a conversion error by selecting only rows with the List tag, I lose the String data.
Is there any way to do what I'm trying to do in a select statement? It feels like this is something that could be done with some creativity, but I'm still in the learning process and my SQL isn't quite there yet.