flip this query

R

rodchar

hey all,
i have a query that produces the following results:

field1 field2 field3
------ ------ -------
val1 val2 val3

well there are so many fields that it would fit better if displayed in
portrait. is there a way to take these results and make it like the following:

field1: val1
field2: val2
field3: val3

or would i need to modify the original query? and if so, what concept/basic
syntax would be involved?

thanks,
rodchar
 
J

Jerry Whittle

Show us the SQL of your existing query. Open the query in design view. Next
go to View, SQL View and copy and past it here. Some sample data would be
nice too.

Hopefully it's a crosstab query that has the word TRANSFORM in it. If not,
the problem may well be that the table isn't properly normalized in that it
should probably look like what you want to see in the first place.

Hopefully I'm wrong (frequently) and your data is something like:

Jerry
Whittle
123 Main St.
Anytown
Illinois
55555
 
R

rodchar

i don't have any real code yet i'm just trying to get to correct concept.
basically my original post sql was referring to a straight select statement:
select field1, field2, field3 from myTable

so it seems i should do some research on crosstab queries
 
J

John W. Vinson

i don't have any real code yet i'm just trying to get to correct concept.
basically my original post sql was referring to a straight select statement:
select field1, field2, field3 from myTable

so it seems i should do some research on crosstab queries

.... but first, perhaps you should do some research on normalization;
if it's equally logical to have field1, field2 and field3 in a
tall-skinny table vs. a wide-flat table, you may have an incorrect
data structure, and the tall-skinny would be better *for the table
itself*. It's much easier to use a crosstab query to flatten a
tall-thin table than to normalize a wide-flat spreadsheet!

John W. Vinson [MVP]
 

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