Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Table 1:

DocId,DocumentName,ModuleId


Table 2:

Id,DocumentTypeId,ModuleId,ModuleDetailId.



Want to create a pivottable with Document Name as Column headers

and whenTable2.DocumentTypeID = DocId then put 'Y' as Value
otherwise 'N'

Please suggest asolution.
Posted

1 solution

There are a lot of tutorials available that tell you how to accomplish it (like this[^] one). However, it only works when you know the number of distinct values on your DocumentName field. If yes, you can go check that tutorial. If not, pivoting the table would not be a good idea in my opinion. If the values on your DocumentName field are dynamic, I suggest just joining the tables on your query and add an additional field where you can put the 'N' and 'Y' values.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900