Append queries - Column Headers

J

Jessica

I have a database that someone else built, and I am building reports for.
They want a graph put on a report and the table is set up with multiple
columns with the names of the data type (i.e. Description 1, Description 2,
etc.). I know that I can only have two columns of data for a graph (pie
chart), and I know that I have to create an append query to update values to
another table because the graph does not like that my report data is filtered
by criteria. How do I make the append query I am trying to create use the
Description 1, Description 2 fields as data values.

Basically, I have this:
ID Number Description 1 Description 2 Description 3
5 $100.00 $250.00 $125.00

And I want this:
ID Number Description Price
5 Description 1 $100.00
5 Description 2 $250.00
5 Description 3 $125.00

The price I know how to do, it is associating a value next to it with the
other table's column headings as data.

Thanks for any help, and I hope I explained this well.
 
V

vanderghast

SELECT [ID Number], "Description1" AS Description, Description1 AS Price
FROM tableName
UNION ALL
SELECT [ID Number], "Description2", Description2 FROM tableName
UNION ALL
SELECT [ID Number], "Description3", Description3 FROM tableName


in SQL view, since you cannot define an UNION query in the graphical query
editor.



Vanderghast, Access MVP
 
J

Jessica

Thank you, I will give it a try.
--
Jessica


vanderghast said:
SELECT [ID Number], "Description1" AS Description, Description1 AS Price
FROM tableName
UNION ALL
SELECT [ID Number], "Description2", Description2 FROM tableName
UNION ALL
SELECT [ID Number], "Description3", Description3 FROM tableName


in SQL view, since you cannot define an UNION query in the graphical query
editor.



Vanderghast, Access MVP



Jessica said:
I have a database that someone else built, and I am building reports for.
They want a graph put on a report and the table is set up with multiple
columns with the names of the data type (i.e. Description 1, Description
2,
etc.). I know that I can only have two columns of data for a graph (pie
chart), and I know that I have to create an append query to update values
to
another table because the graph does not like that my report data is
filtered
by criteria. How do I make the append query I am trying to create use the
Description 1, Description 2 fields as data values.

Basically, I have this:
ID Number Description 1 Description 2 Description 3
5 $100.00 $250.00 $125.00

And I want this:
ID Number Description Price
5 Description 1 $100.00
5 Description 2 $250.00
5 Description 3 $125.00

The price I know how to do, it is associating a value next to it with the
other table's column headings as data.

Thanks for any help, and I hope I explained this well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top