?
Solved

using ms/access crosstab to obtain a value

Posted on 2015-01-17
2
Medium Priority
?
96 Views
Last Modified: 2015-01-17
I have a table with three columns. The first column has a reference to a table. And the second, to another table, like this:

Table Before:

Reference          Type        Code
Ref1                    A             C001
Ref2                    A             C002
Ref3                    A             C003
Ref4                    B             C005
Ref1                    B             C007
Ref5                    B             C006
Ref3                    B             C008
Ref2                    B             C009

In need to produce a table containing:

Reference         A         B
Ref1                  C001    C007
Ref2                  C002    C009
Ref3                  C003     @null
Ref4                  @null   C005
Ref5                  @null    C006

it is a bit like the crosstab but, instead of a sum ou a count I do need to have the actual values. Crosstab does not allow me for that (only accepts counts/sums as the value, and I do need the values as they are key to another table for a report.

can anyone help?
0
Comment
Question by:João serras-pereira
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 40555055
try this query

TRANSFORM First(tblRef.[Code]) AS FirstOfCode
SELECT tblRef.[Reference]
FROM tblRef
GROUP BY tblRef.[Reference]
PIVOT tblRef.[Type];

Open in new window

0
 

Author Closing Comment

by:João serras-pereira
ID: 40555124
Thanks!!!!!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question