Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate question

Status
Not open for further replies.

SpaceMonkey4969

Programmer
Joined
May 8, 2003
Messages
6
Location
CA
Hello

My question is:

I have 1 table, it is a table for USERS. In this table I store information about the user such as IP ADDRESS, Name, ID, time and Date.

I need to create a query that will Select the users Name, Ip, date and time etc, for a distinct IP. AKA a user can log in from many different locations, So i want to select there information from the table for each location they've logged in from.

so here is some data

24.66.19.216 dave 5/5/2003
24.66.19.216 dave 5/6/2003
24.66.19.216 dave 5/7/2003
24.77.77.77 dave 5/6/2003
24.77.77.77 dave 5/7/2003
etc..

I need a query that will only give me the Unique IP's for Dave. meaning i need to get the results of:

24.66.19.216 dave 5/6/2003
24.77.77.77 dave 5/6/2003

I simply just need the locations they've logged in from.

Please help :)

Thanks in advance
 
select ip,name,min(date) from c group by name,ip
or
select ip,name,max(date) from c group by name,ip

You really dont mind which date you are picking?
 
Well, the thing is the main things i'm trying to display is, when a USER logs in from outside our network, I want to be able to display the IP they logged in from, and the all the other information in the USERS table, which is:
strUserName, strIPAddress, intUserID, datDateTime, strGroupName

And I need to display all this information to the user.
 
so any error you are getting?

what about your stGroupName?Does strUserName determines Groupname?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top