→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎07-17-2012 07:22 PM
Select Top 1000000 tblComputers.Computername, tblComputers.ComputerUnique, Convert(VARCHAR(10),tblBIOS.ReleaseDate,101) As [BIOS Date], Cast(Round(DateDiff(day, tblBIOS.ReleaseDate, GetDate()) / 365.00, 2) As Numeric(8,2)) As [Years Old], tblComputersystem.Manufacturer + ' ' + tblComputersystem.Model As [Make/Model], Replace(Replace(tblOperatingsystem1.Caption, 'Microsoft ', ''), 'Microsoft(R) ', '') As OS, tblComputers1.Lastseen As [Last Seen] From tblComputers Inner Join tblBIOS On tblComputers.Computername = tblBIOS.Computername Inner Join tblComputers tblComputers1 On tblComputers1.Computername = tblBIOS.Computername Inner Join tblComputersystem On tblComputers.Computername = tblComputersystem.Computername And tblComputers1.Computername = tblComputersystem.Computername Inner Join tblOperatingsystem On tblComputers.Computername = tblOperatingsystem.Computername And tblComputers1.Computername = tblOperatingsystem.Computername Inner Join tblOperatingsystem tblOperatingsystem1 On tblComputers.Computername = tblOperatingsystem1.Computername And tblComputers1.Computername = tblOperatingsystem1.Computername Order By Cast(Round(DateDiff(day, tblBIOS.ReleaseDate, GetDate()) / 365.00, 2) As Numeric(8,2)) Desc
Solved! Go to Solution.
‎06-04-2018 11:13 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
Convert(nVARCHAR(10),tblBIOS.ReleaseDate,101) As [BIOS Date],
Cast(Round(DateDiff(day, tblBIOS.ReleaseDate, GetDate()) / 365.00,
2) As Numeric(8,2)) As [Years Old],
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tsysOS.OSname As OS,
tblAssets.SP,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Inner Join tblState On tblState.State = tblAssetCustom.State
Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblBIOS On tblAssets.AssetID = tblBIOS.AssetID
Where tblState.Statename = 'Active'
Order By [Years Old] Desc
‎08-21-2018 10:08 AM
‎08-21-2018 11:08 AM
Charles.X wrote:
I know it's a bit late....
‎06-04-2018 12:04 PM
‎06-04-2018 11:13 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
Convert(nVARCHAR(10),tblBIOS.ReleaseDate,101) As [BIOS Date],
Cast(Round(DateDiff(day, tblBIOS.ReleaseDate, GetDate()) / 365.00,
2) As Numeric(8,2)) As [Years Old],
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tsysOS.OSname As OS,
tblAssets.SP,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Inner Join tblState On tblState.State = tblAssetCustom.State
Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblBIOS On tblAssets.AssetID = tblBIOS.AssetID
Where tblState.Statename = 'Active'
Order By [Years Old] Desc
‎06-04-2018 09:42 AM
‎07-18-2012 11:18 AM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now