Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 How to display multiple entries into columns?

Author  Topic 

kamen99
Starting Member

3 Posts

Posted - 2002-07-11 : 10:54:12
In MS Access, how can I display the field with repeated entries in columns?

For example : A file with the following fields :
field 1 : name
field 2 : year
field 3 : rate

file structure like this :
Name Year Rate
Peter 1999 B
Peter 2000 A
Peter 2001 A
May 2000 A
May 2001 A

Desired query output will be

name Year1 Rate1 Year2 Rate2 Year3 Rate3
Peter 1999 B 2000 A 2001 A
May 2000 A 2001 A

And one more condition, the number of entries for each person may vary from 0 to 7.

Any suggestion on how to do it?

Your assistance will be appreciated.

Regards

Kamen

MikeB
Constraint Violating Yak Guru

387 Posts

Posted - 2002-07-11 : 11:05:23
Look up crosstab query in help. I am pretty sure this will do what you want.

Mike B

Go to Top of Page

kamen99
Starting Member

3 Posts

Posted - 2002-07-11 : 20:53:47
I'd try the crosstab query, but it display number of counts or sum. I would like to show the content of the database instead of count or sum.



Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-07-12 : 08:04:24
Use Max or Min in your crosstab instead of sum or count.

Go to Top of Page

btamsgn
Starting Member

4 Posts

Posted - 2007-12-05 : 05:22:31
Hi Kamem,

I'm also a problem like you

Until now, I not still find a idea for it.

Have a nice working day!

If you found & resolved it, pls send email to me:
greenmaple@vnn.vn, thanks!


--------
Tammy
greenmaple@vnn.vn
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-12-05 : 06:10:36
This is orignally an MS Access query, as OP wrote.
Read about TRANSFORM in the MS Access help file.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-12-05 : 07:36:58
quote:
Originally posted by btamsgn

Hi Kamem,

I'm also a problem like you

Until now, I not still find a idea for it.

Have a nice working day!

If you found & resolved it, pls send email to me:
greenmaple@vnn.vn, thanks!


--------
Tammy
greenmaple@vnn.vn


http://sqlteam.com/forums/topic.asp?TOPIC_ID=93711

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

btamsgn
Starting Member

4 Posts

Posted - 2007-12-07 : 21:34:28
Hi

Thanks for your reply.

I don't know many about SQL

Could I send the attachment via your email

Pls advise your email, I'll send my problem to you.

THANK YOU.
Tammy
Go to Top of Page
   

- Advertisement -