‎02-08-2013 10:07 PM
Select Top 1000000 web40licenseview.License, web40licenseview.[number in use] As [In use], web40licenseview.Nrlicenses As Purchased, web40licenseview.Priceperlicense As Price, web40licenseview.Missing As Missing, tblsublicenses.softwareName As Sublicense, web40usedsoftware.[number in use] As [In use sublicense] From web40licenseview Inner Join tblLicenses On web40licenseview.LicenseidID = tblLicenses.LicenseidID Left Outer Join (web40usedsoftware Inner Join tblsublicenses On web40usedsoftware.softwareName = tblsublicenses.softwareName And IsNull(web40usedsoftware.softwareVersion, '') Like IsNull(tblsublicenses.softwareVersion, '')) On tblLicenses.LicenseidID = tblsublicenses.LicenseidID Order By web40licenseview.License, tblsublicenses.softwareName
Select web40OStotal.OS, web40OStotal.[Number in use],
IsNull(tblOsLicenses.Nrlicenses, 0) As Purchased,
IsNull(tblOsLicenses.Priceperlicense, 0) As PriceperLicense, Case
When (web40OStotal.[Number in use] > IsNull(tblOsLicenses.Nrlicenses,
0)) Then (web40OStotal.[Number in use] - IsNull(tblOsLicenses.Nrlicenses,
0)) Else Null End As Missing, Case
When (web40OStotal.[Number in use] > IsNull(tblOsLicenses.Nrlicenses,
0)) Then (web40OStotal.[Number in use] - IsNull(tblOsLicenses.Nrlicenses,
0)) * IsNull(tblOsLicenses.Priceperlicense, 0) Else Null End As Total
From web40OStotal Left Outer Join
tblOsLicenses On web40OStotal.OS = tblOsLicenses.OS
Order By Case
When (web40OStotal.[Number in use] > IsNull(tblOsLicenses.Nrlicenses,
0)) Then (web40OStotal.[Number in use] - IsNull(tblOsLicenses.Nrlicenses,
0)) * IsNull(tblOsLicenses.Priceperlicense, 0) Else Null End Desc
Select Distinct Top 1000000 tblLicenses.softwareName As Name,
tblSublicensesOrders.Nrlicenses As Purchased
From tblLicenses
Left Join tblsublicenses On tblLicenses.LicenseidID =
tblsublicenses.LicenseidID
Inner Join tblSublicensesOrders On tblLicenses.LicenseidID =
tblSublicensesOrders.LicenseidID
Solved! Go to Solution.
‎02-11-2013 05:50 PM
Select Distinct Top 1000000 tblOsLicenses.OS As Name,
upgrade_web40OStotal.[Number in use] As [In Use],
tblOssubLicensesOrders.Nrlicenses As Purchased,
upgrade_web40OStotal.[Number in use] - tblOssubLicensesOrders.Nrlicenses As
Missing
From tblOssubLicenses
Inner Join tblOsLicenses On tblOsLicenses.OSLicenseidID =
tblOssubLicenses.OSLicenseidID
Inner Join tblOssubLicensesOrders On tblOsLicenses.OSLicenseidID =
tblOssubLicensesOrders.OSLicenseidID
Inner Join upgrade_web40OStotal On tblOsLicenses.OS = upgrade_web40OStotal.OS
Select Distinct Top 1000000 tblLicenses.softwareName As Name,
tblSublicensesOrders.Nrlicenses As Purchased,
upgrade_web40usedsoftware.[number in use] As [In Use],
upgrade_web40usedsoftware.[number in use] - tblSublicensesOrders.Nrlicenses As
Missing
From tblLicenses
Left Join tblsublicenses On tblLicenses.LicenseidID =
tblsublicenses.LicenseidID
Inner Join tblSublicensesOrders On tblLicenses.LicenseidID =
tblSublicensesOrders.LicenseidID
Left Join upgrade_web40usedsoftware On tblLicenses.softwareName =
upgrade_web40usedsoftware.softwareName
‎02-11-2013 05:50 PM
Select Distinct Top 1000000 tblOsLicenses.OS As Name,
upgrade_web40OStotal.[Number in use] As [In Use],
tblOssubLicensesOrders.Nrlicenses As Purchased,
upgrade_web40OStotal.[Number in use] - tblOssubLicensesOrders.Nrlicenses As
Missing
From tblOssubLicenses
Inner Join tblOsLicenses On tblOsLicenses.OSLicenseidID =
tblOssubLicenses.OSLicenseidID
Inner Join tblOssubLicensesOrders On tblOsLicenses.OSLicenseidID =
tblOssubLicensesOrders.OSLicenseidID
Inner Join upgrade_web40OStotal On tblOsLicenses.OS = upgrade_web40OStotal.OS
Select Distinct Top 1000000 tblLicenses.softwareName As Name,
tblSublicensesOrders.Nrlicenses As Purchased,
upgrade_web40usedsoftware.[number in use] As [In Use],
upgrade_web40usedsoftware.[number in use] - tblSublicensesOrders.Nrlicenses As
Missing
From tblLicenses
Left Join tblsublicenses On tblLicenses.LicenseidID =
tblsublicenses.LicenseidID
Inner Join tblSublicensesOrders On tblLicenses.LicenseidID =
tblSublicensesOrders.LicenseidID
Left Join upgrade_web40usedsoftware On tblLicenses.softwareName =
upgrade_web40usedsoftware.softwareName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now