cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
SimplyClueless
Engaged Sweeper III
Hello Forum!!

I wonder if anyone could help me - pretty basic query but a lot of stuff I want to exclude;


basically I am just looking for a report that shows me "cumputers by uptime" wanna see who is leaving their computers on-

I think there is a value somewhere like "lastboot" but- I suck-

Can someone help with a query that lists PC by last boot time, or, uptime if it exists- and if possible- Just PC's- IE no monitors-network gear- or servers?

thanks as always guys-
1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
Please use the following report, to see how long an asset has been on.

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) / 3600 /
24))) + ':' +
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) / 3600 %
24))) + ':' +
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) % 3600 /
60))) As [uptime day:hour:minutes]
From tblAssets
Order By tblAssets.AssetName

View solution in original post

3 REPLIES 3
Hemoco
Lansweeper Alumni
Please use the following report, to see how long an asset has been on.

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) / 3600 /
24))) + ':' +
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) / 3600 %
24))) + ':' +
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) % 3600 /
60))) As [uptime day:hour:minutes]
From tblAssets
Order By tblAssets.AssetName
SimplyClueless
Engaged Sweeper III
Helpful and thanks - but it does look like this just gives me a report of all asssets that are currently "on"

is it possible to filter this to just PC's- and show how LONG they have been on using lastboot or uptime?
Hemoco
Lansweeper Alumni
Please use the following query to see which computers are online at the moment that you are running the report.


Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName
From tblAssets
Where (Select Top 1 tblUptime.EventType From tblUptime
Where tblUptime.AssetId = tblAssets.AssetID Order By tblUptime.EventTime) = 1

To use the report above, do the following:
• Open the report builder under Reports/Create New Report.
• Paste the SQL code we provided at the bottom of the page.
• Left-click somewhere in the upper section of the page so the code applies.
• Give the report a Title and hit the Save & Run button to save it. Export options are listed on the left.