That's not quite what I am after
for example:
192.168.0.3 31/01/2004 09:15:45 index.asp
192.168.0.3 31/01/2004 09:16:45 page1.asp
192.168.0.3 31/01/2004 09:17:45 page2.asp
192.168.0.3 31/01/2004 10:15:45 index.asp
192.168.0.3 31/01/2004 10:16:45 page1.asp
192.168.0.3 31/01/2004 12:15:45 index.asp
The above logs would represent 3 separate visits. The first 3 page requests have less than 15 minutes separating them. There is then an hour to the next visit and then 2 hours to the one after that.
Therefore SQL should return 31/01/2004 3
Main Topics
Browse All Topics





by: namasi_navaretnamPosted on 2004-01-31 at 11:05:35ID: 10243280
Visited only once within last 15 minites:
SELECT ipaddress, COUNT(*) AS visit
FROM visitors
WHERE datediff( 'mi' , visitdate , getdate() ) <= 15
GROUP BY ipaddress
HAVING COUNT(*) = 1
HTH