‎04-21-2010 03:44 AM
##ERROR: Cannot open report Wrong OU or PC Name
Argument Data type int is invalid for argument 1 of substring function
Select tbladcomputers.Computername, tbladcomputers.OU As [Current OU],
Case
When SubString(tbladcomputers.Computername, 1, 3) = SubString(SubString(tbladcomputers.OU, 1, 6), 4, 3)
Then 'false'
Else 'true'
End As [Name-OU not matching], tblComputers.Lastseen
From tbladcomputers
Inner Join tblComputers On tbladcomputers.Computername = tblComputers.Computername Where tbladcomputers.OperatingSystem = 'Windows XP Professional'
And SubString(tbladcomputers.Computername, 1, 3) <> SubString(SubString(tbladcomputers.OU, 1, 6), 4, 3)
And SubString(tbladcomputers.Computername, 1, 3) <> 'TRN'
Or tbladcomputers.OU = 'CN=Computers,DC=us,DC=firm,DC=fowlerwhite,DC=com'
And tbladcomputers.OperatingSystem = 'Windows XP Professional'
‎04-21-2010 08:46 AM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now