‎10-03-2019 03:10 PM
Solved! Go to Solution.
‎10-03-2019 05:01 PM
SELECT
tblLicenses.softwareName,
tblSublicensesOrders.Orderdate,
tblLicenses.LicenseExpiration,
DATEDIFF(d, tblSublicensesOrders.Orderdate, tblLicenses.LicenseExpiration) AS LicenseDuration,
DATEDIFF(d, GETDATE(), tblLicenses.LicenseExpiration) AS [Days to Expiration],
CASE
WHEN DATEDIFF(d, GETDATE(), tblLicenses.LicenseExpiration) <= 0
THEN '#ffcccc'
END As backgroundcolor
FROM
tblSublicensesOrders
INNER JOIN tblLicenses ON tblLicenses.LicenseidID = tblSublicensesOrders.LicenseidID
ORDER BY
tblLicenses.softwareName,
tblSublicensesOrders.Orderdate
‎10-03-2019 07:59 PM
‎10-03-2019 05:01 PM
SELECT
tblLicenses.softwareName,
tblSublicensesOrders.Orderdate,
tblLicenses.LicenseExpiration,
DATEDIFF(d, tblSublicensesOrders.Orderdate, tblLicenses.LicenseExpiration) AS LicenseDuration,
DATEDIFF(d, GETDATE(), tblLicenses.LicenseExpiration) AS [Days to Expiration],
CASE
WHEN DATEDIFF(d, GETDATE(), tblLicenses.LicenseExpiration) <= 0
THEN '#ffcccc'
END As backgroundcolor
FROM
tblSublicensesOrders
INNER JOIN tblLicenses ON tblLicenses.LicenseidID = tblSublicensesOrders.LicenseidID
ORDER BY
tblLicenses.softwareName,
tblSublicensesOrders.Orderdate
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now