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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Opinio Last Login Data

Status
Not open for further replies.

Marclem

Technical User
Aug 5, 2003
87
0
0
US
Hi Everyone,

I am a newbie getting started with SQL and did some search online but so far have not been able to solve and gather the data I need.

I need to get all users last login data so I may then delete user accounts that not logged in for a long time as I have reached the max license usage for this system.

I have found the Opinio SQL table and drilled down to table OPS_UserAttribute where I can see column named AttributeName which when I run a search on this table using MySQL the data results in last login instead of showing me the actual date of last login (below a screenshot of data I am looking for)
Last_Login_data_vczh5i.png
.

I ran below SQL command but all I got was data as 0 or 1:
sql_CMD_f7yx9h.png



Thank you in advance for your support!
 
 https://files.engineering.com/getfile.aspx?folder=486efcb6-0242-4c5c-b956-cee2de8db3c8&file=Last_Login_data.png
Is this Microsoft SQL Server or MySQL? If the latter then you are in the wrong forum.

Just a guess, but is the select statement carrying out a comparison and returning 0 or 1 depending on whether the comparison is true or false?
 
It states it is MySQL... All I need is to gather the users "Last Login" data so I may delete users which have not logged in for a long time...
 
Apologies, I thought since it is SQL I could request here.
 
Looks like your request:[tt]
SELECT 'AttributeName' [highlight #FCE94F]=[/highlight] "last login" FROM 'opinio'.'OPS.UserAttribute'...[/tt]
is a comparison between AttributeName and last login and that's why you are getting either 0 (not equal) or 1 (equal)

Try:[tt]
SELECT * FROM 'opinio'.'OPS.UserAttribute'
WHERE AttributeName = "last login"[/tt]
and see what you get.

To see what you deal with, I would start with:
[tt]SELECT DISTINCT AttributeName FROM opinio_OPS.UserAttribute[/tt]
---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top