SCCM Query to get uptime for machines installed

hello ,

i need sccm query to get the uptime for machines installed . anyone can help on provide this .

i have the below query and given syntax error :

SELECT
cs.Name0 AS ‘ComputerName’,
DATEDIFF(HOUR, os.LastBootUpTime0, ws.LastHWScan)
AS ‘Uptime (in Hours)’,
CONVERT(VARCHAR(26), os.LastBootUpTime0, 100)
AS ‘Last Reboot Date/Time’,
CONVERT(VARCHAR(26), ws.LastHWScan, 101)
AS ‘Last Hardware Inventory’
FROM
dbo.v_GS_WORKSTATION_STATUS ws
LEFT OUTER JOIN dbo.v_GS_Operating_System os
ON ws.ResourceID = os.ResourceID
LEFT OUTER JOIN dbo.v_GS_COMPUTER_SYSTEM cs
ON cs.ResourceID = os.ResourceID
WHERE os.Caption0 LIKE ‘%server%’
ORDER BY os.LastBootUpTime0 ASC
Jaber MMAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
Ryan ChongCommented:
it seems that you're using and for the quotes, it should be ' and ' instead.

spot the difference?
0
 
Jaber MMAuthor Commented:
@Ryan Chong

yes i am using the correct one but still the same ( ' ' )
0
All Courses

From novice to tech pro — start learning today.