SMSUG.ca

...your virtual communITy
Welcome to SMSUG.ca Sign in | Join | Help
in Search

Garth Jones

Query on user history

For full details please see http://www.myitforum.com/Forums/tm.aspx?m=230539&high=

SELECT DISTINCT 
	R.Netbios_Name0, 
	tu.SystemConsoleUser0, 
	tu.logontime
FROM 
	dbo.v_R_System R
	join (
		SELECT 
			husr.ResourceID,
			Husr.SystemConsoleUser0, 
			max(Husr.LastConsoleUse0) as logontime
		FROM 
			dbo.v_HS_SYSTEM_CONSOLE_USER Husr 
		WHERE 
			Husr.SystemConsoleUser0 LIKE 'Gartek\' + @variable 
		Group by 
			husr.ResourceID,
			Husr.SystemConsoleUser0 
	) tu on tu.resourceID = R.resourceID
WHERE 
	tu.SystemConsoleUser0 LIKE 'Gartek\' + @variable 
ORDER BY 
	R.Netbios_Name0 
Published Jul 01 2012, 08:37 AM by Garth
Filed under: , , , , , ,

Comments

No Comments

This Blog

Syndication

News

Training

Powered by Community Server (Non-Commercial Edition), by Telligent Systems