Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Query A Table Twice in a DataSet

$
0
0

I am trying to query a single table and return two sets of data into two columns for a report.

the table in question (tblReviewComments) looks something like this:

Key - ReviewCommentTypeID - PlainText
001 - 15 - "Text of Comment type 1"
002 - 10  - "Text of Commen type 2"

I am trying to return a distinct colum for each type of comment.

The complete query as is can be filtered to show any of the comment types.

SELECT
  tblReview.ReviewName
  ,tblReview.ReviewDate
  ,tblReviewBorrower.BorrowerName
  ,tblReviewBankInfo.BusinessDesc
  ,tblReviewNote.TotalCommitment
  ,tblReviewComment.ReviewCommentTypeId
  ,tblReviewComment.PlainText
FROM
  tblReviewBorrower
  INNER JOIN tblReviewBankInfo
    ON tblReviewBorrower.ReviewBorrowerId = tblReviewBankInfo.ReviewBorrowerId
  INNER JOIN tblReviewNote
    ON tblReviewBorrower.ReviewBorrowerId = tblReviewNote.ReviewBorrowerId
  INNER JOIN tblReview
    ON tblReviewBorrower.ReviewKey = tblReview.ReviewKey AND tblReviewNote.ReviewKey = tblReview.ReviewKey
  INNER JOIN tblReviewComment
    ON tblReviewBorrower.ReviewBorrowerId = tblReviewComment.ReviewBorrowerId AND tblReview.ReviewKey = tblReviewComment.ReviewKey



Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>