EventID start office 300
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Username,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.Info,
tblADusers.email,
tblADusers.Department,
tblADusers.Title
From tblAssets
Inner Join tblAssetCustom On tblAssetCustom.AssetID = tblAssets.AssetID
Left Join tblADusers On tblADusers.Username = tblAssets.Username And
tblADusers.Userdomain = tblAssets.Userdomain
Where tblAssetCustom.State = 1 And Exists(Select tblNtlog.AssetID,
tblNtlog.Eventcode From tblNtlog
Where tblNtlog.AssetID = tblAssets.AssetID And tblNtlog.Eventcode = '300'
And tblNtlog.TimeGenerated >= DateAdd(dd, -90, GetDate()))
Order By tblAssets.AssetName