I would like to add a new field that would indicate the range the count between all records not just 'jones'. Total records 2500+. Sorry for not making myself clearer.
Thanks for any help
Provided that ID is sequential without gaps:
SELECT A.ID, A.Name,A.ID-Nz(Max(B.ID),A.ID) AS Range
FROM tblNames AS A LEFT JOIN tblNames AS B ON A.ID>B.ID AND A.Name=B.Name
GROUP BY A.ID, A.Name;
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.