Ken,
Thanks for your help.
You were right; I took the sp back to Query Analyzer and it did have some syntax errors. I fixed them and now they fill up the report fine.
The reason I was trying to use a sp was that I couldn't get my View working correctly.
Which would you rather use: A View or a stored procedure for better performance?
I'll probably have about 10,000 records coming back and I'll try to filter them as much as possible but there are still going to be some big reports.
When I tried this view it brought back the first page in about 20 seconds (very good) but if I want to page forward one page at a time, it takes a long time to display the next page. It's almost as if the query is being executed again each time the user goes to the next page.
Any suggestions?
Thanks again for the help.
Here's the View":
(I put in the TOP 100 PERCENT so I could get the ORDER BY done on the server).
CREATE VIEW dbo.vwHotBills_rev
AS
SELECT TOP 100 PERCENT Bill.BillNum, Bill.Sponsor, Bill.Title,
Bill.CommitteeDate, Bill.OriginalCommittee, Bill.BAMCode,
Bill.BillMemoCode, CommitteeActions.ActionCode,
BillAssignments.Analyst, Bill.Bill99Code, Bill.SenateNum,
Requests.Requester, BillComment.Comment
FROM (((Bill INNER JOIN
BillAssignments ON Bill.BillNum = BillAssignments.BillNum)
LEFT JOIN
CommitteeActions ON
(Bill.BillNum = CommitteeActions.BillNum) AND
(Bill.BillNum = CommitteeActions.BillNum)) LEFT JOIN
Requests ON Bill.BillNum = Requests.BillNum) LEFT JOIN
BillComment ON Bill.BillNum = BillComment.BillNum
WHERE ((BillAssignments.BillNum IS NOT NULL AND
Requests.BillNum IS NOT NULL) OR
(Bill.Sponsor <> 'Budget' AND (Bill.Bill99Code = 'Y' OR
(Bill.InWAM = 'Y' AND (Bill.BAMCode IN ('R', 'X', 'U')))) AND
CommitteeActions.ActionCode IS NULL))
ORDER BY Bill.BillNum, BillAssignments.Analyst