Hi all:
I have to generate a query so that the first value return me of the I gave by each employee in a rank dated and rank of cards, they are in a board of history, but I have not been able to achieve it since the consultation that generate a single value returns me does not return me the values of all the employees, that I was doing badly?, someone to help me say as achievement to do this?

It's a Sql Server 2000.

The table and the field is History.Link1

I used the next code:

Select Top 1 History.Link1,Card.CardHolderId,Card.CardNumber,Ca rd.Deleted,
CardHolder.RecordId,CardHolder.FirstName,CardHolde r.LastName,CardHolder.Note4,CardHolder.Deleted,
History.Param3,History.Param2,History.Param1,Histo ry.RecvTime,History.Gentime,History.Link2,History. Link3,History.Deleted
From Card
Left Join CardHolder On Card.CardHolderId=CardHolder.RecordId
Left Join History On CardHolder.RecordId=History.Link3
Where (Card.Deleted = 0)And(CardHolder.Deleted = 0)And(History.Deleted = 0)
And(Card.CardNumber Between 1500 And 1600)
And(History.RecvTime >= Convert(DateTime,'2006-09-15 00:00:00',102))And (Recvtime <= Convert(DateTime,'2006-09-30 23:59:59',102))
And(History.Link1 = 10)Or(History.Link1 = 12)Or(History.Link1 = 15)Or(History.Link1 = 17)
And CardHolder.Note4 <> 'Mantenimiento'
Order By Card.CardNumber