I've written a stored procedure that searches through a table containing
attendance actions. One employee can have more cards.

The problem is that I run the procedure and sometimes it returns null,
othertimes it runs correctly. I've isolated the problem around the next
statement:

SELECT Action.actionTypeId FROM Action inner join Card on action.cardID =
Card.cardID

WHERE card.empID= @spp_empId and Action.actionTypeId in (3, 4, 5, 6, 7, 8,
9, 13, 30) and @spp_date between Action.attnIn and isnull( Action.attnOut,
Action.attnIn)

ORDER BY Action.actIn

I run the querry and returns an actionTypeId, and then I run it again and it
returns NULL! When I change one of the params to X and then back to the
original value, it's not NULL again!

This happens in a 10 second interval, no other user on the SQL server, and
this is true for MS SQL Server 7.0 with and without service packs, and for
MSDE 7.0 too.