I have created a report that will show me computers that are on for over 24 hours. The report shows me everything that I need with the exception that computers not scanned that morning show up. I have setup a company wide scan to happen at 2a every morning. If the computers are not on at 2a every morning, I do not want them to show up on this report. I understand that the uptime is calculated based on when the computer was last seen and if the computer is not scanned it will remain in the up state for the report. I would be so grateful if someone could update me report to remove any computer that was not scanned the morning that the report runs. Thanks
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblADusers.Username,
tblAssets.Domain,
tblAssets.IPAddress,
Convert(Decimal(7,2),tblAssets.Uptime / 60 / 60 / 24) As UptimeDays,
tblAssets.Lastseen,
SubString(SubString(tblADusers.OU, CharIndex(',', tblADusers.OU) - 250, 250),
4, 250) As Department,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.email
From tblAssets
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblADusers On tblADusers.Username = tblAssets.Username And
tblADusers.Userdomain = tblAssets.Userdomain
Where tblAssets.AssetName Not Like '(%first3letters of server systems)' And tblAssets.AssetName Not Like
'(%first 3 letters of hand scan systems)' And tblAssets.AssetName Not Like '(%first 3 letters of phone servers)' And
tblAssets.AssetName Not Like '(specific pc name)' And tblAssets.AssetName
Not Like '(scanner pcs%)' And tblAssets.AssetName Not Like '(specific pc name)' And
Convert(Decimal(7,2),tblAssets.Uptime / 60 / 60 / 24) > 1 And
tblAssets.Lastseen > GetDate() - 1 And SubString(tblADusers.OU, 4,
15) Not Like 'OU=' And tblAssetCustom.State = 1 And
tblComputersystem.Domainrole = 1 And tblAssetCustom.Manufacturer Not
Like '(Virtual Desktops%)'
Order By UptimeDays Desc