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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help With SP

Status
Not open for further replies.

shiggyshag

Programmer
Dec 14, 2001
227
GB
Hi

I not sure what you would call what I want to do.
What I need is a way to change the way the data is displayed in an SP

My results are currently like this and they come from multiple tables.

Number Percent Grade
1 50 C
1 20 E
4 99 A
4 99 A

But what I need is

Number Percent Grade Percent Grade
1 50 C 20 E
4 99 A 99 A


They amount of percent/Grade isnt fixed

Please any help would be great

Cheers








 
ShiggyShag,

I'm afraid I'm not going to be a lot of help: all I can offer is that when I was browsing through SQL Server Books Online I came across this functionality. I'm afraid I can't give you anymore than that - I can't remember what my search string was, nor the title of the article. All I can say is that your required functionality is there, and it's described within Books Online.

Happy hunting!
 
Uh, actually wait a minute, I completely misread your question, so ignore my last post.

What you need to do is a join on the number field. i.e. if your results are coming from two tables (ResultsA and ResultsB) you would use something along the lines of the following:

SELECT A.Number, A.Percent, A.Grade, B.Percent, B.Grade
FROM ResultsA A
INNER JOIN ResultsB B on A.Number = B.Number

If you have more than two tables simply append the extra fields to the SELECT clause, and join these tables on the Number.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top