Find client summary dates in local time format

select s.Client_Version0
, s.OperatingSystem0
, s.Creation_Date0
, s.Last_Logon_Timestamp0 as LastLogonTimestamp
, DATEADD(HH, DATEDIFF (hh, GETUTCDATE(),GETDATE()), cs.LastOnline) as LastOnline
, DATEADD(HH, DATEDIFF (hh, GETUTCDATE(),GETDATE()), cs.LastDDR) as LastDDR
, DATEADD(HH, DATEDIFF (hh, GETUTCDATE(),GETDATE()), cs.LastHW) as LastHW
, DATEADD(HH, DATEDIFF (hh, GETUTCDATE(),GETDATE()), cs.LastSW) as LastSW
, DATEADD(HH, DATEDIFF (hh, GETUTCDATE(),GETDATE()), cs.LastStatusMessage) as LastStatusMessage
, DATEADD(HH, DATEDIFF (hh, GETUTCDATE(),GETDATE()), cs.LastPolicyRequest) as LastPolicyRequest
, DATEADD(HH, DATEDIFF (hh, GETUTCDATE(),GETDATE()), cs.LastHealthEvaluation) as LastHealthEvaluation
, DATEADD(HH, DATEDIFF (hh, GETUTCDATE(),GETDATE()), cs.LastActiveTime) as LastActiveTime
, cs.ClientStateDescription
, DATEADD(HH, DATEDIFF (hh, GETUTCDATE(),GETDATE()), cs.ExpectedNextPolicyRequest) as ExpectedNextPolicyRequest
  from v_r_system s
inner join v_CH_ClientSummary cs on cs.ResourceID = s.ResourceID
where s.Name0 = 'computername'
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s