‎08-13-2015 03:55 PM
Solved! Go to Solution.
‎08-17-2015 11:32 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tWarrantyDetails.WarrantyEndDate,
tWarrantyDetails.ServiceType
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join (Select tblWarranty.AssetId,
Max(tblWarrantyDetails.WarrantyEndDate) As [max warranty end date]
From tblWarranty
Inner Join tblWarrantyDetails On tblWarranty.WarrantyId =
tblWarrantyDetails.WarrantyId
Group By tblWarranty.AssetId) tWarrantyEnd On tWarrantyEnd.AssetId =
tblAssets.AssetID
Inner Join (Select tblWarrantyDetails.ServiceType,
tblWarranty.AssetId,
tblWarrantyDetails.WarrantyEndDate
From tblWarrantyDetails
Inner Join tblWarranty On tblWarranty.WarrantyId =
tblWarrantyDetails.WarrantyId) tWarrantyDetails On tblAssets.AssetID =
tWarrantyDetails.AssetId And tWarrantyEnd.[max warranty end date] =
tWarrantyDetails.WarrantyEndDate
Where tblAssetCustom.State = 1
Order By tblAssets.AssetName
‎08-18-2015 02:44 PM
Convert(nvarchar(10),tblAssetCustom.Warrantydate,101) As [Warranty End Date]
‎08-17-2015 11:32 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tWarrantyDetails.WarrantyEndDate,
tWarrantyDetails.ServiceType
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join (Select tblWarranty.AssetId,
Max(tblWarrantyDetails.WarrantyEndDate) As [max warranty end date]
From tblWarranty
Inner Join tblWarrantyDetails On tblWarranty.WarrantyId =
tblWarrantyDetails.WarrantyId
Group By tblWarranty.AssetId) tWarrantyEnd On tWarrantyEnd.AssetId =
tblAssets.AssetID
Inner Join (Select tblWarrantyDetails.ServiceType,
tblWarranty.AssetId,
tblWarrantyDetails.WarrantyEndDate
From tblWarrantyDetails
Inner Join tblWarranty On tblWarranty.WarrantyId =
tblWarrantyDetails.WarrantyId) tWarrantyDetails On tblAssets.AssetID =
tWarrantyDetails.AssetId And tWarrantyEnd.[max warranty end date] =
tWarrantyDetails.WarrantyEndDate
Where tblAssetCustom.State = 1
Order By tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now