Req Help with Crosstab query

P

pottymouthed

Assuming I have 2 tables.


t_sexes

sex_ID Sex_Name
1 Male
2 Female

and

t_names

name_ID name_name sex_id
1 jon 1
2 jason 1
3 Sue 2
4 Bill 1
5 Sally 2

How can I have my results show like this.

Male Jon,Jason,Bill
Female Sue,Sally

I have limited experience with pivot tables but I assume this is the
way to
go......thanks in advance for ahy help.


--
------------------------------------------------------
"A comet is, of course, frozen bodies of ice and dust formed over 4.6
billion years ago---or created 6,000 years ago, depending on whether
or not
you're wrong."
---Jon Stewart
 
D

David F Cox

first reaction: Why not Sex "M" or "F" ? - but that aside ...

What is going to be your column heading? It is going to have to be the same
for Jon and Sue, and for Jason and Sally, if you want those names in the
same column as in your example.

My guess is that you do not have a candidate for column variable. If so one
way to solve this would be to allocate a sequence number starting at 1 for
every male, and a similar sequence number starting at 1 for every female and
use those numbers as the column heading. You can then get that layout with a
crosstab query with Sex as the row variable, sequence as the column
variable, and name as the value variable.
 

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

Similar Threads

Pivot question 1

Top