Good day everyone,<br /><br />I have this table:<br /><br /><font color="red">P DateRBC WBC</font id="red"><br />1 7/03100 100<br />1 8/03150 150<br />1 9/03200 200<br /><br />That i wanted to look like this in a stored proc or function:<br />Parameters: @yr, @P (patient's id)<br /><br /><font color="red">Typ 7/03 8/03 9/03</font id="red"><br />RBC 0100 0150 0200<br />WBC 0100 0150 0200<br /><br />Sort of a crosstab query in MS Access. But the keyword Pivot, when used in a stored proc, was not recognized as such. Have other options of doing a crosstab, but if I could make pivot table work, then I don't have to do the long way in my asp codes. Does anybody has a suggestion? Any sample codes?<br /><br />Your help is highly appreciated.<br />Anjo [<img src='/community/emoticons/emotion-12.gif' alt=':X' />]
Here are some links with examples to a pivot table. http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=786 http://www.databasejournal.com/img/sp_cross.sql http://www.planet-source-code.com/URLSEO/vb/scripts/ShowCode!asp/txtCodeId!680/lngWid!5/anyname.htm Bambola.