Just wondering if anyone can help me with this Query im trying to write.
I have Visitor logging Database and would like to return all Visitors who visited 5 times or more Since May 2009, showing their name, address and postcode.
So Far i have Written
SELECT DISTINCT TOP (100) PERCENT dbo.Visit.VisitDate, dbo.Members.Forename, dbo.Members.Surname, dbo.Members.PostCode, dbo.Members.StreetAddress FROM dbo.Visit INNER JOIN dbo.Members ON dbo.Visit.MemberID = dbo.Members.MemberID WHERE (dbo.Visit.VisitDate >= CONVERT(DATETIME, '2009-05-01 00:00:00', 102)) GROUP BY dbo.Members.Forename, dbo.Members.Surname, dbo.Members.MemberID, dbo.Members.StreetAddress, dbo.Members.PostCode, dbo.Visit.VisitDate ORDER BY dbo.Visit.VisitDate
Which returns nearly what i need however shows singular visits made by the users
any help would be appreciated