select Year(entryDate) as pivot_col, EntryDate FROM EXCZ_WellcentPointTotal ew
INNER JOIN USR_Demographics as o ON (ew.UserID=o.UserID)
join EXCZ_measurements lu on o.UserID=lu.UserID
WHERE o.CustId=277
) as t
pivot
(
COUNT(entryDate) for pivot_col in ([2009],[2010],[2011],[2012])
) as p
--
Chandu