Select o.Operation, p.Name As 'Person in Charge',
r.Name As 'Reviser', op.Name As 'Operator'
From Operations o
Inner Join Persons p On o.[Person in Charge] = p.ID
Inner Join Persons r On o.Reviser = r.ID
Inner Join Persons op On o.[Operator] = op.ID;
Display names of another table
David Beltran
0
Reputation points
I need help doing this realcion by which I have to join these two tables which I have data like:
TABLE: PERSONS
TABLE: OPERATIONS
and i want to
SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,061 questions
SQL Server Other
14,494 questions
2 answers
Sort by: Most helpful
-
Tom Cooper 8,481 Reputation points
2023-02-13T16:00:26.0533333+00:00 -
Anonymous
2023-02-14T01:48:38.89+00:00 Hi @David Beltran
If you want to use a function in your report to do this, you can use the Lookup function, which retrieves the value for a name-value pair from a specified dataset. For detailed usage of Lookup function, you can check this link: Lookup function.
I simply did a test according to your request. First add the two data sets "ID" and "Operation". Then add the following table and add the expression.
Person in charge: =Lookup(Fields!Persion_in_Charge.Value,Fields!ID.Value,Fields!Name.Value,"ID") Reviser: =Lookup(Fields!Reviser.Value,Fields!ID.Value,Fields!Name.Value,"ID") Operator: =Lookup(Fields!Operator.Value,Fields!ID.Value,Fields!Name.Value,"ID")
Preview:
Best regards,
Aniya