Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross tab maybe not sure

Status
Not open for further replies.

saintedmunds

Technical User
Apr 7, 2006
78
GB
HI

I have a table with the following fields
Surname DivisionID FormID

What I need to be able to do is create a query/sp that gives me the following

FormID D1 D2 D3 D4
6 smith Jones blogs green
6 orange dog cat smart

Do i make any sense?
Any ideas would be great.

Cheers
 
looks like a cross tab to me. I don't know sql well enough to post some code of the top of my head, and I am not sure if you can easily do Cross-tabs in MSSQL server - but if I were in that situation one 'guerilla' method I might try is to set up a simulation table in MSAccess (if you have it around) and use the grid or the wizard to create the cross-tab query as you want it, and then cut/paste the SQL code into MSSQL and see if it works.
 
Hi
Thanks for your replies.
I have looked at crosstabs on the net but they all seem to need a Summaries column but I dont need this.

Does any one else have an answer to my question please.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top