Re: [Emerald] Find who was online by time and IP address

Josh Hillman ( (no email) )
Mon, 26 Jul 1999 13:03:42 -0400

> I'd like to find what user was on-line at such-and-such IP address
> at such-and-such time. How is this done?

/* Username associated with IP address at specific point in time */

/* If a STOP record (AcctStatusType=2) was not entered into the */
/* database by radius, this script will not work. */

SET NOCOUNT ON
DECLARE @datetime char(20)
DECLARE @IPAddress char(15)

SELECT @datetime = '7/3/99 11:29am'
SELECT @IPAddress = '123.123.123.123'

SELECT Username,
"Start Of Session" = DateAdd(Second, 0 - AcctSessionTime - AcctDelayTime, CallDate),
"End Of Session" = DateAdd(Second, 0 - AcctDelayTime, CallDate),
"Seconds" = AcctSessionTime,
"IP Address" = FramedAddress,
CallerID
FROM Calls
WHERE DateAdd(Second, 0 - AcctSessionTime - AcctDelayTime, CallDate) <= @datetime
AND DateAdd(Second, 0 - AcctDelayTime, CallDate) >= @datetime
AND FramedAddress = @IPAddress
AND AcctStatusType = 2

For more information about this list (including removal) go to:
http://www.iea-software.com/support/maillists/liststart