Solved

using ms/access crosstab to obtain a value

Posted on 2015-01-17
2
84 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:jirdeaid
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
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:jirdeaid
Comment Utility
Thanks!!!!!!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

771 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now