Vrtual Columns

  • Thread starter Thread starter Jerry Baker
  • Start date Start date
J

Jerry Baker

I have a table like this:

NAME CODE FREQUENCY
-------------------------
Bob 1 3
Frank 3 2
Bob 3 4
Joe 2 1
Joe 1 2

I need a query to return results like this:

NAME CODE 1 CODE 2 CODE 3
------------------------------
Bob 3 0 4
Frank 0 0 2
Joe 2 1 0

I cannot change the database as it is pre-existing and must remain in
its current configuration. I have tried a lot of variations of GROUP BY
and SELECT AS, but I can't seem to make it work right.

Thanks for any help you can give.
 
Try a crosstab query where NAME (not a good name for a field) is the Row
Heading, "Code " &
Code:
 is the Column Heading, and Sum of Frequency is the
value.
 
Duane said:
Try a crosstab query where NAME (not a good name for a field) is the Row
Heading, "Code " &
Code:
 is the Column Heading, and Sum of Frequency is the
value.[/QUOTE]

Will that group the two rows containing BOB into one row?
 
Try it.

--
Duane Hookom
MS Access MVP
--

Jerry Baker said:
Duane said:
Try a crosstab query where NAME (not a good name for a field) is the Row
Heading, "Code " &
Code:
 is the Column Heading, and Sum of Frequency is
the value.[/QUOTE]

Will that group the two rows containing BOB into one row?[/QUOTE]
 
Back
Top