Thanks bud, that code works stand-alone, now I'm trying to do a couple of joins to filter;
Inner Join personalprofiles PP
ON
L.ProfileId = PP.ID
Inner Join CurrentStudentMembership As CSM
on
CSM.[First name] = PP.[Fname]
And CSM.[Last name] = PP.[Lname]
Where [l].[Paid] > 0
But wherever I put them, I keep getting
Msg 4104, Level 16, State 1, Line 1160
The multi-part identifier "CSM.First name" could not be bound.
Msg 4104, Level 16, State 1, Line 1161
The multi-part identifier "PP.Fname" could not be bound.
Msg 4104, Level 16, State 1, Line 1162
The multi-part identifier "CSM.Last name" could not be bound.
Msg 4104, Level 16, State 1, Line 1163
The multi-part identifier "PP.Lname" could not be bound.