In its simplest form I can get the first record of several by using the top (1). For example, this works fine: SELECT TOP (1) GiftFactID FROM FACT_SolicitorGift
WHERE (GiftFactID = 83532)
But I need to use this in a more complicated program. I am linking a gift with the name and address of the person who gave then gift and then going back and trying to grab the first solicitor in the fact_solicitorgift file so the gift isn't duplicated on a report. This is being done in a subquery because not every gift will have a solicitor record in the file. I'm including just that portion of code that addresses this issue. I end up getting no names when I use the Top (1) code. If I remove that portion of the code I end up getting 2 records - which I don't want... I only want the top record.
.... LEFT OUTER JOIN
(SELECT top (1) SG.GiftFactID, SG.ConstituentDimID, SC.FullName AS giftsolname
FROM FACT_SolicitorGift AS SG INNER JOIN
DIM_Constituent AS SC ON SG.SolicitorConstituentDimID = SC.ConstituentDimID) AS G ON G.GiftFactID = FACT_Gift.GiftFactID