SELECT create_date AS 'SQL Server Installed Date', Expiry_date AS 'SQL Server Expiry Date', DATEDIFF(dd,create_date, GETDATE()) 'No_of_Days_Used', ABS(DATEDIFF(dd,expiry_date,GETDATE())) 'No_Of_Days_Left'FROM(SELECT sp.create_date, DATEADD(dd, 180, sp.create_date) AS Expiry_date FROM sys.server_principals sp WHERE sp.name = 'NT AUTHORITY\SYSTEM') as exp_date_tbs