Headings to rows in a query

E

Eva

Hi
I have a number of columns in the query and I created one column called data
from and I would like to put those headings to rows. How to do it?
Example
Cost C Cost D Data From
1122 Cost C
1122 Cost D

Can you advise how to do it?
--


Greatly appreciated

Eva
 
S

Steve

Usually you do something like this in labels on the form or report which
uses your query as a recordsource. Please explain why you want to do this in
your query.

Steve
(e-mail address removed)
 
J

Jeff Boyce

I'm not exactly clear on what you are trying to do...

If you are trying to "flip" the rows for the columns, one approach would be
to export what you have to Excel and use the Transpose function there.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary
 
K

KARL DEWEY

Thats why you should not have data in a spreadsheet fashion.

Try this --
SELECT [Cost C], [Cost D], IIF([Cost C] Is Not Null, "Cost C", "Cost D") AS
[Data From]
FROM YourTable
WHERE [Cost C] Is Not Null AND [Cost D] Is Not Null;

What will you do if both have data?
 
E

Eva

Hi
Thank you for your help. It is not possible that both will have both data. I
used yuor suggesrion and it works perfect!
--


Greatly appreciated

Eva


KARL DEWEY said:
Thats why you should not have data in a spreadsheet fashion.

Try this --
SELECT [Cost C], [Cost D], IIF([Cost C] Is Not Null, "Cost C", "Cost D") AS
[Data From]
FROM YourTable
WHERE [Cost C] Is Not Null AND [Cost D] Is Not Null;

What will you do if both have data?


--
Build a little, test a little.


Eva said:
Hi
I have a number of columns in the query and I created one column called data
from and I would like to put those headings to rows. How to do it?
Example
Cost C Cost D Data From
1122 Cost C
1122 Cost D

Can you advise how to do it?
--


Greatly appreciated

Eva
 

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