troubleshooting Question

T-sql Pivoting Problem for drawing issue register

Avatar of czwg
czwgFlag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft SQL ServerSystem UtilitiesMicrosoft Server Apps
3 Comments1 Solution315 ViewsLast Modified:
I'm preparing a drawing issue register. I've been doing this for years but utilising formal issues in a separate table. I need VIRTUAL issues to be produced from the data. A virtual issue, the column (In) in my pivot table, is a unique set of recipients (Rn) for a date. As you can see some drawings (not shown) will have been issued on the same date (Dn) but to a different unique set of recipients, or on a different date to the same set:
eg

Pivot arrangement
This should be simple but I can't get my head round it. Maybe this is the onset of middle age...

I want to take (simplified)

tblRevIssues
fldIssuedDate
fldIssuedTo
fldDrawingRevision

and create 3 derived tables with the magic virtual IssueNo:

tblIssues
fldIssueNo
fldIssuedDate

tblIssueRecipients
fldIssueNo
fldIssuedTo

tblIssueDrawings
fldIssueNo
fldDrawingRevision

I'm comfortable with cursors, table variables etc. Less so with the pivot command and ranking but happy to look at these methods. Just need a steer in the right direction!

Then I can generate the register.
I'm familiar with this process.

Finished register
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros