i'm using this stored procedure that everyone and their mother got off this site somewhere to page through the recordsets. only problem is, i cant get a total recordset count used for individual page numbers. i've posted this here before, but have yet to get any help. this is the bit of code in the sp right now. this var is returned to the page just fine.<BR><BR>SELECT *, <BR> MoreRecords = <BR> ( <BR> SELECT COUNT(*) <BR> FROM #TempItems TI <BR> WHERE TI.tempID >= @LastRec <BR> ) <BR>FROM #TempItems <BR>WHERE tempID > @FirstRec AND tempID < @LastRec <BR><BR>so i assumed something like this would return the total recordsets found...<BR><BR>SELECT *, <BR> RScount = <BR> ( <BR> SELECT COUNT(*) <BR> FROM #TempItems TI <BR> ) <BR>FROM #TempItems <BR><BR>but that doesnt work. i get an error on the line of code asking for the MoreRecords variable. this has to be something simple. i've done searches on here and on google and havent found anything. its all refering to vb counts. not tsql.