Link to home
Start Free TrialLog in
Avatar of adwooley2
adwooley2

asked on

PIVOT TABLE - SQL Server 2000

Hello.  I am trying to develop an ASP.NET app that displays linear data as a pivot table, and I have no idea how to go about it. My table is set up like this:
VESSEL
VOYAGE
PORT
ARRIVAL
I want this to display in a table like the following:
VESSEL   VOYAGE   PORT1   PORT2   PORT3   (Ports are different)
vsl1          voy1          date1      date2    date3
vsl2          voy2          date1      date2    date3
vsl3          voy3          date1      date2    date3

Can somebody help me with this? In Access, this is pretty easy, but how do I do this in SQL Server 2000?
Avatar of Sham Haque
Sham Haque
Flag of United Kingdom of Great Britain and Northern Ireland image

here's a nice explanation of how to achieve this, using CASE:

Creating cross tab queries and pivot tables in SQL
http://www.simple-talk.com/sql/t-sql-programming/creating-cross-tab-queries-and-pivot-tables-in-sql/
ASKER CERTIFIED SOLUTION
Avatar of Sham Haque
Sham Haque
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adwooley2
adwooley2

ASKER

Appears easy.  I'll give it a try.  Thanks for your quick response.

Regards,
Alan