Thank you!
But I used another solution. I added register key scan and scanned for SQL 2005 & 2008
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.MSSQLSERVER\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 10 DisplayName
HKEY_LOCAL_MACHINE\ SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 2005 DisplayName
And then I used this query and just changed the value for dbo.[0sqlversions2].Value and dbo.tblRegistry.Value for getting Standard or Exopress edition and SQL 2005:
SELECT TOP (100) PERCENT dbo.[0sqlversions2].Computername AS [Server Name], dbo.tblComputers.Domain, dbo.tblRegistry.Value AS [SQL Version],
dbo.[0sqlversions2].Value AS [SQL Edition], dbo.tblComputers.Lastseen
FROM dbo.[0sqlversions2] INNER JOIN
dbo.tblRegistry ON dbo.[0sqlversions2].Computername = dbo.tblRegistry.Computername INNER JOIN
dbo.tblComputers ON dbo.tblRegistry.Computername = dbo.tblComputers.Computername
WHERE (dbo.tblRegistry.Valuename = 'DisplayName') AND (dbo.[0sqlversions2].Valuename = 'Edition')
GROUP BY dbo.[0sqlversions2].Value, dbo.tblRegistry.Value, dbo.[0sqlversions2].Computername, dbo.tblComputers.Domain, dbo.tblComputers.Lastseen
HAVING (dbo.[0sqlversions2].Value = 'Workgroup Edition') AND (dbo.tblRegistry.Value = 'Microsoft SQL Server 2008')