 IF @ExcludeFeedbackStatusMask IS NULL
 	SET @ExcludeFeedbackStatusMask = ~0
 
-DECLARE @FirstId int
+DECLARE @FirstDate datetime
 DECLARE @StartRow int
 DECLARE @StartRowIndex int
 

)
AS

DECLARE @FirstId int
DECLARE @StartRow int
DECLARE @StartRowIndex int


	INNER JOIN [<dbUser,varchar,dbo>].[subtext_LinkCategories] cats ON (l.CategoryID = cats.CategoryID)
	Left JOIN  subtext_EntryViewCount vc ON (content.[ID] = vc.EntryID AND vc.BlogId = @BlogId)
WHERE 	content.BlogId = @BlogId 
	AND content.DateAdded <= @FirstDate
	AND content.PostType = @PostType
	AND cats.CategoryID = @CategoryID
ORDER BY content.DateAdded DESC
 
SELECT COUNT(content.[ID]) AS TotalRecords
FROM [<dbUser,varchar,dbo>].[subtext_Content] content
