cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mullendg
Engaged Sweeper
I am using the following query anmd it give me multiple lines for some PC's, is there a way to resolve this please?

Select tblComputers.Computer, tblComputers.LastknownIP,
dbo.tblComputersystem.Manufacturer, dbo.tblComputersystem.Model,
tblComputerSystemProduct.IdentifyingNumber, tblComputers.Userdomain,
tblADusers.Displayname, tblADusers.Description, tblADusers.Office,
tblComputers.Username, tblADusers.Telephone, tblADusers.Mobile,
tblADusers.email, tblADusers.Department, tblADusers.Title,
tblComputers.Lastseen
From dbo.tblComputersystem Inner Join
tblComputers On tblComputers.Computername = dbo.tblComputersystem.Computername
Inner Join
tblComputerSystemProduct On tblComputers.Computername =
tblComputerSystemProduct.Computername Inner Join
tblADusers On tblComputers.Username = tblADusers.Username
Where tblComputers.Userdomain Like '%DOMAIN1%' And
dbo.tblComputersystem.Domainrole < '2'
4 REPLIES 4
mullendg
Engaged Sweeper
That seems to fix it, Many Thanks!
Hemoco
Lansweeper Alumni
You need to link table tblcomputers to tbladusers on both username and userdomain.
mullendg
Engaged Sweeper
Computer LastknownIP Manufacturer Model IdentifyingNumber
780MTIMAGE 10.41.200.2 Dell Inc. OptiPlex 780 JFJZddd
780MTIMAGE 10.41.200.2 Dell Inc. OptiPlex 780 JFJZddd


Here you go...
taeratrin
Champion Sweeper
I ran the query against my data, but didn't find any duplicates. Could you post an example of the output?