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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Creating Categorised Views

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-07-14 : 07:24:03
Adnan writes "I want to create a view for a staff directory.

My DB has two fields i.e. Name and Department. I want the View to show each person grouped by Department.
I would use. "SELECT * FROM tablename GROUP BY Department;"
It works BUT how can I NOT have the Department name repeat for each person??

I want something like this:

http://webster.gcrc.sunysb.edu/gcrc.nsf/directory

The Department Name should show up only ONCE and the persons in the department listed in the column alongside it.Then the next Department and its members.. and so on..

Help will be appreciated. "

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-07-14 : 07:25:49
That's not a query issue, it is a presentation issue. You need to get a report writer and construct a report based on your query. You can suppress duplicates and perform grouping and sub-grouping in a report writer more easily than in a query. MS Access can handle this quite readily.

Go to Top of Page
   

- Advertisement -