James Asante
Old Hand
Points: 311
More actions
April 11, 2005 at 7:47 am
#85523
Could someone convert this Access crosstab to sql 2000 for me.
TRANSFORM Count(Quickvote.ID) AS CountOfID
SELECT Quickvote.Comb, Count(Quickvote.ID) AS [Total Of ID]
FROM Quickvote
GROUP BY Quickvote.Comb
PIVOT Quickvote.Location;
Steve Jones - SSC Editor
SSC Guru
Points: 728164
April 11, 2005 at 8:42 am
#551861
The only way to do this is self join or use code from a front end tool.
select comb, cnta, cntb, cntc
from ( select comb, count(*) 'cnta'
from quickvote a
where locaiton = 'z'
) a
inner join ( select comb, count(*) 'cnta'
where locaiton = 'y'
) b
on a.comb = b.comb
...
Follow me on Twitter: http://www.twitter.com/way0utwestForum Etiquette: How to post data/code on a forum to get the best helpMy Blog: www.voiceofthedba.com
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply