→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !
‎09-17-2013 07:45 PM
Solved! Go to Solution.
‎09-24-2013 04:16 PM
Technut27 wrote:
So the entire report looks like this now
Select Top 1000000 tblAssetCustom.AssetID,
tblAssets.AssetUnique,
tblAssets.Description As [Local Description],
tblADComputers.Description As [AD Description],
tblAssets.Username As [Last User],
tblADusers.Department,
tblADusers.Title As [Job Title],
tsysOS.OSname,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssetCustom.PurchaseDate As [Purchase Date],
tblAssetCustom.Warrantydate As [Warranty Expiration],
tsysOS.Image As icon
From tblAssetCustom
Inner Join tblAssets On tblAssetCustom.AssetID = tblAssets.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblADusers On tblAssets.Username = tblADusers.Username And
tblADusers.Userdomain = tblAssets.Userdomain
Where tblAssetCustom.Warrantydate < '2015-01-01' And
(tblComputersystem.Domainrole < 2 Or tblComputersystem.Domainrole > 1) And
tblAssetCustom.State = 1
Order By [Warranty Expiration] Desc
‎09-26-2013 01:33 AM
‎09-20-2013 08:49 PM
Inner Join tblADusers On tblAssets.Username = tblADusers.Username
Select Top 1000000 tblAssetCustom.AssetID,
tblAssets.AssetUnique,
tblAssets.Description As [Local Description],
tblADComputers.Description As [AD Description],
tblAssets.Username As [Last User],
tblADusers.Department,
tblADusers.Title As [Job Title],
tsysOS.OSname,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssetCustom.PurchaseDate As [Purchase Date],
tblAssetCustom.Warrantydate As [Warranty Expiration],
tsysOS.Image As icon
From tblAssetCustom
Inner Join tblAssets On tblAssetCustom.AssetID = tblAssets.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblADusers On tblAssets.Username = tblADusers.Username
Where tblAssetCustom.Warrantydate < '2015-01-01' And
(tblComputersystem.Domainrole < 2 Or tblComputersystem.Domainrole > 1) And
tblAssetCustom.State = 1
Order By [Warranty Expiration] Desc
‎09-24-2013 04:16 PM
Technut27 wrote:
So the entire report looks like this now
Select Top 1000000 tblAssetCustom.AssetID,
tblAssets.AssetUnique,
tblAssets.Description As [Local Description],
tblADComputers.Description As [AD Description],
tblAssets.Username As [Last User],
tblADusers.Department,
tblADusers.Title As [Job Title],
tsysOS.OSname,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssetCustom.PurchaseDate As [Purchase Date],
tblAssetCustom.Warrantydate As [Warranty Expiration],
tsysOS.Image As icon
From tblAssetCustom
Inner Join tblAssets On tblAssetCustom.AssetID = tblAssets.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblADusers On tblAssets.Username = tblADusers.Username And
tblADusers.Userdomain = tblAssets.Userdomain
Where tblAssetCustom.Warrantydate < '2015-01-01' And
(tblComputersystem.Domainrole < 2 Or tblComputersystem.Domainrole > 1) And
tblAssetCustom.State = 1
Order By [Warranty Expiration] Desc
‎09-20-2013 01:37 AM
INNER JOIN tblADusers ON tblAssets.Userdomain = tblADusers.Userdomain AND tblAssets.Username = tblADusers.Username
SELECT TOP 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblADusers.Name
FROM
tblAssets
INNER JOIN tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
INNER JOIN tsysAssetTypes ON tsysAssetTypes.AssetType = tblAssets.Assettype
INNER JOIN tblADusers ON tblAssets.Userdomain = tblADusers.Userdomain AND tblAssets.Username = tblADusers.Username
WHERE
tblAssetCustom.State = 1
‎09-19-2013 11:58 PM
‎09-17-2013 11:16 PM
Andsince it's redundant. SQL Server will likely optimize it out, but why not keep it tidy if you can? <grin>
(tblComputersystem.Domainrole < 2 Or tblComputersystem.Domainrole > 1)
‎09-17-2013 10:45 PM
‎09-17-2013 08:50 PM
SELECT TOP 1000000
tblAssetCustom.AssetID,
tblAssets.AssetUnique,
tsysOS.OSname,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssetCustom.PurchaseDate AS [Purchase Date],
tblAssetCustom.Warrantydate AS [Warranty Expiration],
tsysOS.Image AS icon
FROM
tblAssetCustom
INNER JOIN tblAssets ON tblAssetCustom.AssetID = tblAssets.AssetID
INNER JOIN tblComputersystem ON tblAssets.AssetID = tblComputersystem.AssetID
INNER JOIN tsysOS ON tblAssets.OScode = tsysOS.OScode
WHERE
tblAssetCustom.State = 1
AND tblComputersystem.Domainrole < 2
AND tblAssetCustom.Warrantydate < '2015-01-01'
ORDER BY
[Warranty Expiration] Desc
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now