cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jpjayko
Engaged Sweeper
Trying to query all printers network and local and the model names. on top of excluding certain local options like fax cutepdf etc. I can get report to run but now excluding anything
SELECT
tblcomputers.ComputerUnique,
tblPrinters.Caption,
tblPrinters.Portname,
tblPrinters.Sharename,
tblPrinters.Location,
tblPrinters.Comment
FROM
tblcomputers
INNER JOIN tblPrinters ON (tblcomputers.Computername = tblPrinters.Computername)
WHERE
tblPrinters.Caption NOT LIKE 'Microsoft%' OR
tblPrinters.Caption NOT LIKE 'CutePDF%' OR
tblPrinters.Caption NOT LIKE 'FAX' OR
tblPrinters.Caption NOT LIKE 'Adobe%'
1 REPLY 1
Hemoco
Lansweeper Alumni
You need to use AND instead of OR

SELECT
tblcomputers.ComputerUnique,
tblPrinters.Caption,
tblPrinters.Portname,
tblPrinters.Sharename,
tblPrinters.Location,
tblPrinters.Comment
FROM
tblcomputers
INNER JOIN tblPrinters ON (tblcomputers.Computername = tblPrinters.Computername)
WHERE
tblPrinters.Caption NOT LIKE 'Microsoft%' AND
tblPrinters.Caption NOT LIKE 'CutePDF%' AND
tblPrinters.Caption NOT LIKE 'FAX' AND
tblPrinters.Caption NOT LIKE 'Adobe%'