→ The Lansweeper Customer Excellence Awards 2024 - Submit Your Project Now! Learn More & Enter Here

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Michael_V
Champion Sweeper III
This reports gives a list of all computers that will be merged if you enable windows rename detection.

SELECT 
'/asset.aspx?assetid=' + Cast(d.y As NVARCHAR(1000)) As
[hyperlink_Asset A],
y.AssetName As [hyperlink_name_Asset A],
y.IpAddress [IP Address A],
'/asset.aspx?assetid=' + Cast(d.z As NVARCHAR(1000)) As
[hyperlink_Asset B],
z.AssetName As [hyperlink_name_Asset B],
y.IpAddress [IP Address B]
FROM
(
SELECT DISTINCT y.AssetID y, z.AssetID z FROM
(SELECT a.AssetID, AssetUnique, m.Mac, Serialnumber, Model FROM tblAssets a JOIN tblAssetCustom c ON a.AssetID = c.AssetID JOIN tblAssetMacAddress m ON a.AssetID = m.AssetID WHERE Assettype=-1) y
JOIN
(SELECT a.AssetID, AssetUnique, m.Mac, Serialnumber, Model FROM tblAssets a JOIN tblAssetCustom c ON a.AssetID = c.AssetID JOIN tblAssetMacAddress m ON a.AssetID = m.AssetID) z
ON y.AssetUnique <> z.AssetUnique AND y.Mac = z.Mac AND y.Serialnumber = z.Serialnumber AND y.Model = z.Model AND y.AssetID > z.AssetID
)d
JOIN tblAssets y ON d.y = y.AssetID
JOIN tblAssets z ON d.z = z.AssetID
2 REPLIES 2
laurentiune
Engaged Sweeper
I get this error: There was an error parsing the query. [ Token line number = 1,Token line offset = 178,Token in error = Select ]
laurentiune wrote:
I get this error: There was an error parsing the query. [ Token line number = 1,Token line offset = 178,Token in error = Select ]

I cannot reproduce this behavior in SQL Compact or SQL Server. (Based on some of your other posts, I believe you're using SQL Compact.) Could you ensure that you copied the query correctly. Try pasting it in Notepad first and from there into the report builder.